Skip to content

Run a YAML spec over the source - #60

Merged
peterbjohnson merged 9 commits into
devfrom
wb/t26
Sep 20, 2026
Merged

peterbjohnson merged 9 commits into
devfrom
wb/t26

Conversation

@peterbjohnson

Copy link
Copy Markdown
Member

Layer 1 of a draft. A spec is a small YAML file of selectors over the pandoc AST that says which blocks are questions, parts and solutions, with strip patterns, ignore rules and a layout. The four filters stay exactly as they are and are what the layout field names: a spec with layout: PartsSepSol applies that filter's logic to the blocks the selectors picked out. The worked example in the agent spec shows the shape:

question: Header level=2 text~"^Question"
part:     Para text~"^\([a-z]\)"
solution: after Header text="Solutions", label~"^\d+(\([a-z]\))?"
strip:    ["^\([a-z]\) ", "^\d+(\([a-z]\))? "]
ignore:   Header level=1
layout:   PartsSepSol

in2lambda spec run SPEC fills the draft's fields with provenance, records the spec's hash in the draft, and returns coverage: which blocks are in no field and not ignored. Done when each saved spec plus its source in the test data produces its expected draft, so a new pair dropped in the test data is a new test with no code, and a spec that names an unknown layout or selector is refused with the line.


Workbench ticket t26.

@peterbjohnson
peterbjohnson merged commit a943a63 into dev Sep 20, 2026
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant