docs(syntax): fix frontmatter examples that silently emptied the whole block #266
No reviewers
Labels
No labels
bug
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gram-lang/gram!266
Loading…
Reference in a new issue
No description provided.
Delete branch "docs/frontmatter-densities-example"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The frontmatter only reads flat
key: valuelines (KeyValue = emptyLine* key ":" sp* value nlingrammar.ohm). Two documented examples broke that rule, silently:reference/syntax/document-structure.mdx(en + fr): the example emptied the whole frontmatter. Both its indenteddensities:list and its# Functional Fieldscomment line makeFrontmatterfail, so the block is read as a step of text andmetais empty (checked withgetAST). It now usesdensities: [flour:0.55, milk:1.03]with no comment line; all 9 keys and both densities are read.densitiesis described as an inline list instead of an "Object", and a caution aside under "YAML block" says only flat lines are read: a# …line or an indented line makes the whole block unreadable, and a trailing#is part of the value.explanation/mass-and-yield.mdx(en + fr):densities: { flour: 0.55 }only worked by accident with one entry ({ flour: 0.55, water: 1 }gives no override at all). It now readsdensities: [flour:0.55].Docs only, no changeset. The snippet audit reports the same 126 flags as before.
Left for later on
dev/1.6: the frontmatter examples of thegram-authoringskill and ofgram-spec.tscarry trailing# …comments that end up in the values (AI spec examples test, PR 3 of the DX plan).