Cheatsheet
A concise reference guide to the Gram syntax and notation.
Basic elements
Section titled “Basic elements”Essential markup tokens used directly inside recipe steps:
| Element | Prefix | Syntax | Example | Description |
|---|---|---|---|---|
| Ingredient | @ | @name[{quantity}] | @flour{200g} | Declares an ingredient. Omitting {} indicates no specific quantity (e.g. @salt). |
| Cookware | # | #name[{quantity}] | #pan{2}, #whisk | Specifies kitchen equipment. Omitting {} defaults to a single item (1). |
| Timer | ~ | ~{time} | ~{30min}, ~{1h30} | Active cooking or preparation duration (1 hr 30 mins, 1:30 h, 5'30"). |
| Temperature | ^ | ^{temperature} | ^{180°C}, ^{350°F} | Exact heat setting (C or F, case-insensitive). |
| Target state | = | ={state} | ={ribbon stage}, ={golden} | Sensory cue to reach, placed anywhere in the step. |
Modifiers
Section titled “Modifiers”Modifiers are placed immediately after the @ or # symbol to alter behavior:
| Modifier | Meaning | Example | Effect |
|---|---|---|---|
& | Reference | @&flour | References an ingredient declared earlier without adding it again to the shopping list. |
= | Fixed quantity | @=salt{1 tsp} | Marks the quantity as fixed: it will not scale when portions change. |
? | Optional | @?thyme | Flags the item as optional for the cook. |
- | Hidden | @-sugar | Suppresses the ingredient from the generated shopping list. |
* | Baker’s base | @*flour{500g} | Sets the reference ingredient (100%) for baker’s percentage calculations. |
Advanced syntax
Section titled “Advanced syntax”Specialized patterns for flexible culinary instructions:
| Feature | Syntax pattern | Example | Description |
|---|---|---|---|
| Quantity range | min-max | @eggs{2-4} | Averaged as 3 for metrics while preserving display text. |
| Substitutions | item|alt | @milk{100ml}|@water{95ml} | Declares interchangeable alternatives. |
| Short-hand prep | (...) | @butter{10g}(room temp) | Notes prep techniques without cluttering names. |
| Component alias | :slug | @dry white wine:wine{10ml} | Displays user-friendly text while mapping to a canonical ID. |
| Relative quantity | % @&target | @water{70% @&flour} | Computes amount relative to a reference ingredient mass. |
| Ratio with units | a / b @&target | @eggs{1 / 100 g @&flour}, @salt{15 g / L @&water} | Amount per reference amount of another ingredient, in any compatible units (space around /). |
| Composite child | <@parent | @lemon zest{1}<@lemon | Bundles parts (zest, juice) into a single shopping item. |
| Passive timer | ~_ | ~_{1h} | Represents resting/rising time without blocking the cook. |
| Proportional time | ~{time / b @&target} | ~{15 min / 500 g @&roast}, ~{4 min / @&cutlet} | Duration scaled dynamically by an ingredient’s weight or count. |
| Named timer | ~name{...} | ~eggs{3min}, ~_oven{45min} | Queues resource-constrained steps (named tracks). |
| Semantic temperature | ^{text} | ^{medium heat}, ^{simmer} | Expresses qualitative stove settings. |
| Temperature note | ^{...}(note) | ^{320°F}(fan), ^{145°F}(internal) | Oven mode or measurement condition, always displayed. |
| Target state note | ={...}(note) | ={it coats the spoon}(a finger leaves a clean line) | How to verify the target state, always displayed. |
| Fractions | n/d or Unicode | @flour{1 1/2 cups}, @sugar{½ cup} | Fully supported across imperial and metric systems. |
| Sum of quantities | a + b, a - b | @flour{1 cup + 1 tbsp}, @sugar{1 cup - 2 tbsp}, @rice{1 cup + 20 g} | Preserved as written and summed; incompatible kinds stay side by side. |
Every parenthetical note (...)—on an ingredient, cookware, temperature, or target state—must touch the preceding token on the same line; with a space, it remains ordinary text.
Intermediate variables
Section titled “Intermediate variables”Intermediate variables capture sub-components (such as doughs, sauces, or garnishes) for later assembly:
| Target | Syntax | Example | Scope |
|---|---|---|---|
| Step-level | ->&name at end of step | Mix until smooth. ->&dough | Captures the output of that single step. |
| Section-level | ->&name in section title | ## Puff Pastry ->&pastry | Captures the combined output of the entire section. |
Section scheduling
Section titled “Section scheduling”Retro-planning anchors schedule preparations in advance:
| Syntax | Example | Purpose |
|---|---|---|
~{-time} | ## Preferment ~{-1d} | Tells the scheduler this section must be completed 1 day before serving. |
Related resources
Section titled “Related resources”Document structureFull syntax for frontmatter metadata, sections, steps, and comments.
Ingredients syntaxDetailed guide for units, quantities, preparation notes, and alternatives.
Write your first recipeStep-by-step tutorial taking you through authoring a complete .gram file.
CLI referenceExplore all gram CLI commands for building, checking, and cooking recipes.