Skip to content

Supported Syntax Features

Complete table of Cooklang syntax features supported by cooklang-parse.

Feature Support Matrix

FeatureSyntaxSupportedExample
Ingredients
Single-word ingredient@name@salt
Ingredient with quantity@name{qty}@eggs{3}
Ingredient with quantity + unit@name{qty%unit}@flour{250%g}
Multi-word ingredient@multi word name{}@olive oil{2%tbsp}
Multi-word (no braces)@multi word{qty%unit}@sea salt{1%tsp}
Empty braces@name{}@salt{}
Fixed quantity (in braces)@name{=qty%unit}@salt{=1%tsp}
Note suffix@name{qty%unit}(note)@flour{100%g}(sifted)
Note (no amount)@name(note)@butter(softened)
Alias syntax@display|canonical{}@white wine|wine{100%ml}
Modifier @ (reference)@@name@@tomato sauce{200%ml}
Modifier & (hidden)@&name@&flour{300%g}
Modifier ? (optional)@?name@?garnish
Modifier + (added)@+name@+extra cheese{}
Modifier - (removed)@-name@-onion
Fraction quantity@name{1/2%cup}@sugar{1/2%cup}
Decimal quantity@name{0.5%cup}@water{0.5%cup}
Unicode names@crème fraîche{}@crème fraîche{2%tbsp}
Cookware
Single-word cookware#name#pan
Multi-word cookware#multi word name{}#mixing bowl{}
Cookware with quantity#name{qty}#pan{2}
Cookware note suffix#name(note)#pan(large)
Cookware alias#name|alias{}#frying pan|pan{}
Cookware modifiers#&name, #?name#?blender
Timers
Anonymous timer~{qty%unit}~{20%minutes}
Named timer~name{qty%unit}~rest{5%minutes}
Timer without unit~{qty}~{5}
Bare word timer~name~rest
Metadata
YAML front matter--- fencesSee syntax guide
Metadata directives>> key: value>> servings: 4
Nested YAML valuesObjects, arraystags: [a, b]
Frontmatter suppresses directivesDirectives ignored with ---Matching cooklang-rs
Structure
Double-equals section== Name ==== Prep ==
Single-equals section= Name= Cooking
Multi-line stepsAdjacent linesLines joined with spaces
Step separationBlank linesBlank line = new step
Comments
Inline comment-- textMix well. -- stir gently
Full-line comment-- text (on own line)-- This is a note to self
Block comment[- text -][- removed section -]
Notes
Note line> text> Serve immediately.
Multiple notesMultiple > linesFolded into one text block
Text
@ in plain text@ not followed by wordUse @ symbol
# in plain text# not followed by wordItem # here
-- without spaceNot a commentwell--done
Unicode textAccented, Cyrillic, emojiFull unicode support

Spec Compliance

cooklang-parse is verified against 57 canonical test cases from the official Cooklang spec, plus 17 extended test cases for non-canonical features, achieving exact parity with the cooklang-rs reference implementation.

Released under the MIT License.