chore: add Biome and document design decisions from grill session
- Add @biomejs/biome 2.5.3 with 2-space indent, double quotes, trailing commas - Add lint and format scripts to root package.json - Update CONTEXT.md: resolve Structured Output shape, add Document AST, Block, Inline Node terms - Add ADR 0002 (remark as internal Markdown parser) - Add ADR 0003 (core defines own AST types) - Add spec: core-parser (Parser implementation and Document AST) - Add spec: cli-view (kitchen view <file> command)
This commit is contained in:
@@ -103,12 +103,34 @@ It is a pure function of its input string — no filesystem access.
|
||||
|
||||
## Structured Output
|
||||
|
||||
The data object returned by the Parser for a given Recipe File.
|
||||
Shape is not yet fully specified — see open questions below.
|
||||
The Document AST returned by the Parser for a given Recipe File.
|
||||
See **Document AST** for the exact shape.
|
||||
|
||||
## Document AST
|
||||
|
||||
The full structured representation of a Recipe File returned by the Parser.
|
||||
Top-level shape: `{ frontmatter: Record<string, unknown>, blocks: Block[] }`.
|
||||
`frontmatter` is the raw YAML metadata, passed through without schema enforcement.
|
||||
`blocks` is a flat, ordered list of Block nodes representing the document body in document order.
|
||||
The flat structure means headings and their following content are siblings, not parent/child.
|
||||
Consumers that need section grouping derive it by scanning for Heading nodes.
|
||||
Core defines its own AST node types; remark (the internal Markdown parser) is a private implementation detail and its types do not appear in the public API.
|
||||
See ADR 0002 and ADR 0003.
|
||||
|
||||
## Block
|
||||
|
||||
A top-level node in the Document AST's `blocks` array.
|
||||
Each Block represents one logical unit of document structure: a heading, a paragraph, a list, a code block, etc.
|
||||
Block types are defined by core; the exact catalogue is not yet finalised — see open questions below.
|
||||
|
||||
## Inline Node
|
||||
|
||||
A node representing inline content within a Block (e.g. within a paragraph or list item).
|
||||
Inline nodes include: plain text, emphasis, strong, code span, link, Wikilink, and the three Annotation types (Ingredient, Cookware, Timer).
|
||||
|
||||
---
|
||||
|
||||
## Open / Unresolved
|
||||
|
||||
- **Structured Output shape** — exact fields, types, and nesting of the parse result.
|
||||
- **Block node type catalogue** — the exact set of Block types core defines (heading, paragraph, list, code block, blockquote, etc.) and how unrecognised types are represented.
|
||||
- **Unit normalisation** — the parser should normalise known aliases to a canonical abbreviation (`grams` → `g`, `kilograms` → `kg`); exact alias table and canonical forms are TBD. This is a parser concern, not a format constraint.
|
||||
|
||||
Reference in New Issue
Block a user