Split the recipe method into YAML
P1 priority Donep1-is-split-recipe-method-into-yaml-sidecarRecipe steps are prose, not structured data
- Stage
- 03-done
- Author
- Ivan Hawkes
- Created
- Completed
Recipe steps are prose, not structured data.
A recipe bundle holds two files: index.md, the page, and ingredients.yaml,
the structured ingredients of each dish of the recipe. The method had no
sidecar: every step was written as a markdown list in index.md, under a
section named after the dish it belongs to (## Crust, ## Filling) or under
## Directions. Steps were therefore prose - unqueryable, and styled by
.prose (the reason for is-recipe-list-steps-render-as-paragraphs).
Each recipe is now three files in the same bundle:
index.md- the description and the background, with the method removed.ingredients.yaml- unchanged.method.yaml- new, the steps of each dish, one string per step.
method.yaml mirrors ingredients.yaml: a method-list root, one dish entry
per component, and a method list of steps under each dish.
method-list:
- dish: Steak
method:
- fry the steak
- rest the steak
- dish: Pepper Sauce
method:
- the first step of the recipe
- the second step
- third stepWork
- Method sidecar -
method.yamlin all 58 recipe bundles, with onedishper component and its steps in themethodlist, in file order: 442 steps. - Dish names - each
dishtakes the name of the same dish in the recipe’singredients.yaml, so the two sidecars pair up. A section that names no component (## Directions,## Main) is named by the recipe title. - Step text - one list item is one step, its continuation lines joined into a single string, wording and markdown untouched. 405 list items sat in the original pages: 401 became steps, 7 of them with a parent label prefixed, and 2 stayed (below). 41 steps were written as paragraphs, not list items, and moved too.
- Nested labels - a label item that only names a nested list is folded
into the steps it labels:
Batter:yields “Batter, option 1: …” and “Batter, option 2: …” (sweet-and-sour-pork),Stir fry:prefixes four steps (mongolian-beef), and theAlternatively:paragraph prefixes the first alternative step (char-siu-pork). - Prose stays - background is not a step, and stays in
index.md: descriptions,## Notes,## Optional,## Experimental, the## Why It Workssection of tonkotsu-stock, the falafel variation sections, yields (“Makes 4 cups.”), storage paragraphs, troubleshooting and its two bullets in felafel, and the hygiene paragraph of ginger-beer-bug. A heading that empties out goes with its steps; a heading that keeps prose keeps its heading. Nothing is rewritten and nothing embellished: a step’s text is the text it had. - Specifications - the functional, technical and requirements documents
named
ingredients.yamlas the only recipe sidecar; they namemethod.yamland its shape now. - Checks -
pnpm run testpasses, and a throwaway script compared everymethod.yamlwith the page it came from, from git: each step string is found in the original body, and every list item under a method heading is present in the sidecar.
Acceptance Criteria
pnpm run testpasses: 424 pages with exactly oneh1, 59 placeholder classes and 59 rules matched, cards valid, Prettier clean.- All 58 recipe bundles carry
index.md,ingredients.yamlandmethod.yaml. - Every
method.yamlparses as YAML: amethod-listroot, every entry carries adishstring and amethodlist of non-empty strings. - 49 of 58 bundles name the same dishes in both sidecars. The other 9 keep the
names of the sections they came from -
char-siu-pork,red-braised-pork,sweet-and-sour-pork,porchetta,ginger-beer-bug,lamb-rogahn-josh,murghi-korma,pork-vindalooandhummus- because their ingredients dishes areIngredients,Main,Carameland the like, or a single dish covering several method sections. - The steps removed from
content/post/recipe/**/index.mdare the steps written tomethod.yaml: none lost, duplicated, reworded or invented. The 41 prose steps are kept whole - a paragraph is one step, never split.
Notes
- Rendering is not in this card: the recipe layout reads
index.mdandingredients.yamlonly, so a page built from this card alone shows its ingredients, its meta, and its background, with no method.is-render-the-recipe-method-yamlcovers the theme, and the two cards land together. assets/holds a JSON-schema style definition for card front matter; recipe sidecars have none. A definition formethod.yaml, and the check that applies it, belong to the theme card.- A step string may hold markdown: the link to the light batter recipe in sweet-and-sour-pork, and the bold labels of chile-colorado. Rendering them as markdown, not as text, is the theme card’s job.
Not in scope
- Front matter, ingredients, images, and any recipe text that is not a step.
- The layout, partial and CSS that present the method on the page.
cmd/kan, the board, and the card schema.