diff --git a/README.md b/README.md index 706a1469..6f3ca830 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ description: A simple, highly hydrated dough. ## Dough -[Mix] The @flour{500g}, @water{70% @&flour}, and @salt{10g} in a #large bowl{}. ->&dough +[Mix] @flour{500g}, @water{70% @&flour}, and @salt{10g} in a #bowl(large). ->&dough [Rest] Let the &dough rest for ~_{2h} at ^{room temperature} until doubled in size. diff --git a/packages/cli/src/prompts/gram-spec.ts b/packages/cli/src/prompts/gram-spec.ts index 3007f295..0c133af6 100644 --- a/packages/cli/src/prompts/gram-spec.ts +++ b/packages/cli/src/prompts/gram-spec.ts @@ -138,7 +138,7 @@ One step = one paragraph, separated by blank lines. Always start with an action verb in brackets: \`\`\` -[Mix] The @flour{250g} with @butter{125g}(cold, cubed) until sandy. +[Mix] @flour{250g} with @butter{125g}(cold, cubed) until sandy. [Bind] Add @powdered sugar{70g} and mix until it just comes together. \`\`\` diff --git a/packages/docs/public/examples/empanadas.gram b/packages/docs/public/examples/empanadas.gram index f4f39b22..1c16c1fd 100644 --- a/packages/docs/public/examples/empanadas.gram +++ b/packages/docs/public/examples/empanadas.gram @@ -11,7 +11,7 @@ portions: 5 ## Shortcrust Pastry ->&dough -[Heat] In a #saucepan, the @water{150 ml}, @salt{1/2 tsp}, and @butter{100 g}. ->&butter mixture{} // Remove from heat as soon as the butter melts and let cool. +[Heat] In a #saucepan, @water{150 ml}, @salt{1/2 tsp}, and @butter{100 g}. ->&butter mixture{} // Remove from heat as soon as the butter melts and let cool. [Knead] Incorporate this &butter mixture{} into the @flour{500 g}. Work it to form a ball. // Moisten with an extra splash of water if the dough does not bind well @@ -19,9 +19,9 @@ portions: 5 ## Filling ->&filling -[Sweat] The @onions{200 g}(finely diced) with a drizzle of @oil until translucent. +[Sweat] @onions{200 g}(finely diced) with a drizzle of @oil until translucent. -[Incorporate] The @red bell pepper{1/2}(finely diced). +[Incorporate] @red bell pepper{1/2}(finely diced). [Sear] Add the @ground beef{200 g} over ^{high heat}. diff --git a/packages/docs/public/examples/lemon-tart/bases/shortcrust-base.gram b/packages/docs/public/examples/lemon-tart/bases/shortcrust-base.gram index ea3053ec..ec9a9e8a 100644 --- a/packages/docs/public/examples/lemon-tart/bases/shortcrust-base.gram +++ b/packages/docs/public/examples/lemon-tart/bases/shortcrust-base.gram @@ -5,8 +5,8 @@ description: 'A basic shortcrust pastry, split out so any tart can reuse it.' ## Shortcrust dough -[Mix] The @flour{300 g} with the @butter{200 g}(cold, cubed) until sandy. +[Mix] @flour{300 g} with @butter{200 g}(cold, cubed) until sandy. -[Add] The @egg{50 g} and @salt{3 g}, then bring together into a ball. +[Add] @egg{50 g} and @salt{3 g}, then bring together into a ball. [Rest] Wrapped in the refrigerator for ~_{30min}. diff --git a/packages/docs/public/examples/lemon-tart/lemon-tart.gram b/packages/docs/public/examples/lemon-tart/lemon-tart.gram index 360f7936..e5c5b037 100644 --- a/packages/docs/public/examples/lemon-tart/lemon-tart.gram +++ b/packages/docs/public/examples/lemon-tart/lemon-tart.gram @@ -9,7 +9,7 @@ portions: 8 ## Lemon Curd ->&curd -[Whisk] The @eggs{3}, @sugar{150 g}, and @lemon juice{120 ml}<@lemons{2} in a #saucepan over ^{low heat} until ={thickened}(it coats the back of a spoon), about ~{8min}. +[Whisk] @eggs{3}, @sugar{150 g}, and @lemon juice{120 ml}<@lemons{2} in a #saucepan over ^{low heat} until ={thickened}(it coats the back of a spoon), about ~{8min}. [Incorporate] Remove from heat, blend in the @butter{80 g}, and whisk in until glossy. diff --git a/packages/docs/public/llms-full.txt b/packages/docs/public/llms-full.txt index 6a2c217f..a6672ce8 100644 --- a/packages/docs/public/llms-full.txt +++ b/packages/docs/public/llms-full.txt @@ -243,7 +243,7 @@ A different step. Steps can optionally start with an **Action** enclosed in brackets `[]`. This highlights the primary method used in that step, making it easy to parse visually or programmatically. ```gram -[Mix] The @flour and @water. +[Mix] @flour and @water. [Bake] In the #oven for ~{30min}. ``` @@ -426,7 +426,7 @@ In baking, recipes are often built around the **Baker's Percentage**, where the Gram provides a dedicated modifier to mark the reference `@ingredient`. By placing a `*` after the `@` symbol, you tell the Gram Compiler: *"This is the 100% reference point"*. ```gram -[Add] The @*flour{500g}, @water{350g} and @salt{10g}. +[Add] @*flour{500g}, @water{350g} and @salt{10g}. ``` This allows tools (like the CLI or web renderers) to automatically calculate and display the baker's percentages for all other items (e.g., Water: 70%, Salt: 2%) without you having to define them manually as relative quantities. @@ -1200,7 +1200,7 @@ When placed at the end of a `## Section` title, the variable captures the cumula [Rest] In the #fridge for ~_{1h}. -[Incorporate] The @butter{200g} by folding the dough multiple times. +[Incorporate] @butter{200g} by folding the dough multiple times. // The &puff pastry variable now represents the final output of the entire section. ``` diff --git a/packages/docs/src/content/docs/docs/how-to/organize-modular-recipes.mdx b/packages/docs/src/content/docs/docs/how-to/organize-modular-recipes.mdx index bebb90fd..a556fa47 100644 --- a/packages/docs/src/content/docs/docs/how-to/organize-modular-recipes.mdx +++ b/packages/docs/src/content/docs/docs/how-to/organize-modular-recipes.mdx @@ -26,7 +26,7 @@ If you followed [Your First Recipe](/docs/tutorials/first-recipe), the **Lemon M ```gram title="Original section" ## Sweet Pastry Dough ->&pastry dough{} - [Process] In a #food processor{}, the @flour{180g}, @icing sugar{55g}, and @salt{1/4 tsp}. + [Process] In a #food processor{}, @flour{180g}, @icing sugar{55g}, and @salt{1/4 tsp}. [Crumble] Add the @butter{115g}(cold, cut into small cubes) and mix for ~{1-2min} until sandy. @@ -44,7 +44,7 @@ If you followed [Your First Recipe](/docs/tutorials/first-recipe), the **Lemon M ## Sweet Pastry Dough - [Process] In a #food processor{}, the @flour{180g}, @icing sugar{55g}, and @salt{1/4 tsp}. + [Process] In a #food processor{}, @flour{180g}, @icing sugar{55g}, and @salt{1/4 tsp}. [Crumble] Add the @butter{115g}(cold, cut into small cubes) and mix for ~{1-2min} until sandy. @@ -70,7 +70,7 @@ If you followed [Your First Recipe](/docs/tutorials/first-recipe), the **Lemon M ## Lemon Curd ->&curd - [Whisk] In a #saucepan{}, the @lemon zest{1 tbsp}<@lemon, @lemon juice{120g}<@lemon{2}, @sugar{125% @&lemon juice}, and @eggs{3}. + [Whisk] In a #saucepan{}, @lemon zest{1 tbsp}<@lemon, @lemon juice{120g}<@lemon{2}, @sugar{125% @&lemon juice}, and @eggs{3}. [Cook] Over ^{medium heat} for ~{8min} until thickened. @@ -187,11 +187,11 @@ title: 'Tart Elements' ## Sweet Pastry ->&crust -[Mix] The @flour{200g}, @butter{100g}, @sugar{50g}, and @water{50ml}. Chill for ~_{1h}. +[Mix] @flour{200g}, @butter{100g}, @sugar{50g}, and @water{50ml}. Chill for ~_{1h}. ## Frangipane Cream ->&frangipane -[Cream] The @almond flour{100g}, @butter{100g}, @sugar{100g}, and @eggs{100g}. +[Cream] @almond flour{100g}, @butter{100g}, @sugar{100g}, and @eggs{100g}. ``` In your main recipe, destructured imports let you bind both components cleanly in a single line: @@ -255,7 +255,7 @@ When a preparation must begin days before cooking (such as a sourdough starter, @use "@/components/bases/sourdough-starter.gram" as &starter ~{-2d} ## Main Dough -[Knead] the @bread flour{500g}, @water{350g}, and @salt{10g} with &starter{150g}. +[Knead] @bread flour{500g}, @water{350g}, and @salt{10g} with &starter{150g}. ``` * The sourdough starter's completion is anchored to **2 days before** the main dough is mixed. diff --git a/packages/docs/src/content/docs/docs/how-to/scale-recipes.mdx b/packages/docs/src/content/docs/docs/how-to/scale-recipes.mdx index 3b9d7a57..46d5861a 100644 --- a/packages/docs/src/content/docs/docs/how-to/scale-recipes.mdx +++ b/packages/docs/src/content/docs/docs/how-to/scale-recipes.mdx @@ -11,7 +11,7 @@ This guide shows you how to use **Relative Quantities** to build dynamic, self-d Imagine a bread recipe: ```gram -[Mix] The @flour{500g}, @water{350ml}, @salt{10g} and @yeast{5g}. +[Mix] @flour{500g}, @water{350ml}, @salt{10g} and @yeast{5g}. ``` If you scale this by 2 (e.g., using `gram build --scale 2`), everything doubles. And if you only have `400g` of flour left, you can use reference scaling: `gram build --scale flour=400g`. Gram will compute the multiplier (`0.8`) and adjust everything automatically. @@ -34,16 +34,16 @@ import { Steps, LinkCard, CardGrid } from '@astrojs/starlight/components'; First, define the flour as a standard ingredient in your recipe. ```gram - [Add] The @flour{500g}. + [Add] @flour{500g}. ``` 2. ### Define the relatives Now, replace the static quantities of water, salt, and yeast with percentages pointing to the flour. Since the flour was already defined in a previous step, you reference it using `@&flour`. ```gram - [Add] The @flour{500g}. + [Add] @flour{500g}. - [Pour in] The @water{70% @&flour}, @salt{2% @&flour}, and @yeast{1% @&flour}. + [Pour in] @water{70% @&flour}, @salt{2% @&flour}, and @yeast{1% @&flour}. ``` :::tip @@ -57,7 +57,7 @@ Because the relationships are encoded directly in the recipe, Gram handles the m If you want to tweak the recipe to a wetter 75% hydration, you just change one number: ```gram -[Pour in] The @water{75% @&flour} +[Pour in] @water{75% @&flour} ``` Gram handles the math. You never have to manually calculate absolute weights again when designing or tweaking your recipes. @@ -103,7 +103,7 @@ While Relative Quantities are great for *designing* dynamic recipes, professiona If you have a standard recipe with absolute weights, you can use the **Baker's Percentage Modifier** (`*`) to explicitly tell Gram: *"This ingredient is the 100% reference point"*. ```gram -[Add] The @*flour{500g}, @water{350g} and @salt{10g}. +[Add] @*flour{500g}, @water{350g} and @salt{10g}. ``` The parsed recipe will automatically compute these percentages for any frontend to display. diff --git a/packages/docs/src/content/docs/docs/reference/syntax/document-structure.mdx b/packages/docs/src/content/docs/docs/reference/syntax/document-structure.mdx index 06462929..ded84884 100644 --- a/packages/docs/src/content/docs/docs/reference/syntax/document-structure.mdx +++ b/packages/docs/src/content/docs/docs/reference/syntax/document-structure.mdx @@ -85,7 +85,7 @@ A different step. Steps can optionally start with an **Action** enclosed in brackets `[]`. This highlights the primary method used in that step, making it easy to parse visually or programmatically. ```gram -[Mix] The @flour and @water. +[Mix] @flour and @water. [Bake] In the #oven for ~{30min}. ``` diff --git a/packages/docs/src/content/docs/docs/reference/syntax/ingredients.mdx b/packages/docs/src/content/docs/docs/reference/syntax/ingredients.mdx index 3b77048d..c56946a5 100644 --- a/packages/docs/src/content/docs/docs/reference/syntax/ingredients.mdx +++ b/packages/docs/src/content/docs/docs/reference/syntax/ingredients.mdx @@ -102,7 +102,7 @@ In baking, recipes are often built around the **Baker's Percentage**, where the Gram provides a dedicated modifier to mark the reference `@ingredient`. By placing a `*` after the `@` symbol, you tell the Gram Compiler: *"This is the 100% reference point"*. ```gram -[Add] The @*flour{500g}, @water{350g} and @salt{10g}. +[Add] @*flour{500g}, @water{350g} and @salt{10g}. ``` This allows tools (like the CLI or web renderers) to automatically calculate and display the baker's percentages for all other items (e.g., Water: 70%, Salt: 2%) without you having to define them manually as relative quantities. diff --git a/packages/docs/src/content/docs/docs/reference/syntax/intermediate-variables.mdx b/packages/docs/src/content/docs/docs/reference/syntax/intermediate-variables.mdx index 6b9e15e1..5b65fe0f 100644 --- a/packages/docs/src/content/docs/docs/reference/syntax/intermediate-variables.mdx +++ b/packages/docs/src/content/docs/docs/reference/syntax/intermediate-variables.mdx @@ -48,7 +48,7 @@ When placed at the end of a `## Section` title, the variable captures the cumula [Rest] In the #fridge for ~_{1h}. -[Incorporate] The @butter{200g} by folding the dough multiple times. +[Incorporate] @butter{200g} by folding the dough multiple times. // The &puff pastry variable now represents the final output of the entire section. ``` diff --git a/packages/docs/src/content/docs/docs/reference/syntax/modules.mdx b/packages/docs/src/content/docs/docs/reference/syntax/modules.mdx index 778e00af..275980cf 100644 --- a/packages/docs/src/content/docs/docs/reference/syntax/modules.mdx +++ b/packages/docs/src/content/docs/docs/reference/syntax/modules.mdx @@ -96,11 +96,11 @@ title: 'Tart Elements' ## Sweet Pastry ->&crust -[Mix] The @flour{200g}, @butter{100g}, @sugar{50g}, and @water{50ml}. Chill for ~_{1h}. +[Mix] @flour{200g}, @butter{100g}, @sugar{50g}, and @water{50ml}. Chill for ~_{1h}. ## Frangipane Cream ->&frangipane -[Cream] The @almond flour{100g}, @butter{100g}, @sugar{100g}, and @eggs{100g}. +[Cream] @almond flour{100g}, @butter{100g}, @sugar{100g}, and @eggs{100g}. ``` :::note[Default Exports & Re-exporting] @@ -137,11 +137,11 @@ title: 'Tart Elements' ## Sweet Pastry ->&crust -[Mix] The @flour{200g}, @butter{100g}, @sugar{50g}, and @water{50ml}. Chill for ~_{1h}. +[Mix] @flour{200g}, @butter{100g}, @sugar{50g}, and @water{50ml}. Chill for ~_{1h}. ## Frangipane Cream ->&frangipane -[Cream] The @almond flour{100g}, @butter{100g}, @sugar{100g}, and @eggs{100g}. +[Cream] @almond flour{100g}, @butter{100g}, @sugar{100g}, and @eggs{100g}. ``` ```gram diff --git a/packages/docs/src/content/docs/docs/tutorials/first-recipe.mdx b/packages/docs/src/content/docs/docs/tutorials/first-recipe.mdx index 2c89e67f..efd21cd5 100644 --- a/packages/docs/src/content/docs/docs/tutorials/first-recipe.mdx +++ b/packages/docs/src/content/docs/docs/tutorials/first-recipe.mdx @@ -19,7 +19,7 @@ Start by defining the sweet pastry dough. The `@` symbol is used for ingredients ```gram title="Code" ## Sweet Pastry Dough -[Process] In a #food processor{}, the @flour{180g}, @icing sugar{55g}, and @salt{1/4 tsp}. +[Process] In a #food processor{}, @flour{180g}, @icing sugar{55g}, and @salt{1/4 tsp}. [Crumble] Add the @butter{115g}(cold, cut into small cubes) and mix for ~{1-2min} until sandy. @@ -38,7 +38,7 @@ Start by defining the sweet pastry dough. The `@` symbol is used for ingredients - **egg** (1) - **vanilla extract** (1/2 tsp) -1. **[Process]** In a *food processor*, the **flour** (180 g), **icing sugar** (55 g), and **salt** (1/4 tsp). +1. **[Process]** In a *food processor*, **flour** (180 g), **icing sugar** (55 g), and **salt** (1/4 tsp). 2. **[Crumble]** Add the **butter** (115 g) (cold, cut into small cubes) and mix for ⏲️ 1-2 min until sandy. 3. **[Combine]** Add the **egg** (1), **vanilla extract** (1/2 tsp) (optional) and mix until the dough comes together. 4. **[Rest]** Wrap in plastic wrap and let it rest in the fridge for ⏲️ 1 h. @@ -59,7 +59,7 @@ This is done using an **Intermediate Declaration** (`->&name`) at the end of the ```gram title="Code" ## Sweet Pastry Dough ->&pastry dough{} -[Process] In a #food processor{}, the @flour{180g}, @icing sugar{55g}, and @salt{1/4 tsp}. +[Process] In a #food processor{}, @flour{180g}, @icing sugar{55g}, and @salt{1/4 tsp}. [Crumble] Add the @butter{115g}(cold, cut into small cubes) and mix for ~{1-2min} until sandy. @@ -78,7 +78,7 @@ This is done using an **Intermediate Declaration** (`->&name`) at the end of the - **egg** (1) - **vanilla extract** (1/2 tsp) -1. **[Process]** In a *food processor*, the **flour** (180 g), **icing sugar** (55 g), and **salt** (1/4 tsp). +1. **[Process]** In a *food processor*, **flour** (180 g), **icing sugar** (55 g), and **salt** (1/4 tsp). 2. **[Crumble]** Add the **butter** (115 g) (cold, cut into small cubes) and mix for ⏲️ 1-2 min until sandy. 3. **[Combine]** Add the **egg** (1), **vanilla extract** (1/2 tsp) (optional) and mix until the dough comes together. 4. **[Rest]** Wrap in plastic wrap and let it rest in the fridge for ⏲️ 1 h. @@ -167,10 +167,10 @@ You can use **Relative Quantities** (`% @&target`): ```gram title="Code" -[Whisk] In a #saucepan{}, the @lemon zest{1 tbsp}<@lemon, @lemon juice{120g}<@lemon{2}, @sugar{125% @&lemon juice}, and @eggs{3}. +[Whisk] In a #saucepan{}, @lemon zest{1 tbsp}<@lemon, @lemon juice{120g}<@lemon{2}, @sugar{125% @&lemon juice}, and @eggs{3}. ``` ```markdown title="Preview" -1. **[Whisk]** In a *saucepan*, the **lemon zest** (1 tbsp), **lemon juice** (120 g), **sugar** (150 g), and **eggs** (3). +1. **[Whisk]** In a *saucepan*, **lemon zest** (1 tbsp), **lemon juice** (120 g), **sugar** (150 g), and **eggs** (3). ``` @@ -193,7 +193,7 @@ portions: 8 ## Sweet Pastry Dough ->&pastry dough{} -[Process] In a #food processor{}, the @flour{180g}, @icing sugar{55g}, and @salt{1/4 tsp}. +[Process] In a #food processor{}, @flour{180g}, @icing sugar{55g}, and @salt{1/4 tsp}. [Crumble] Add the @butter{115g}(cold, cut into small cubes) and mix for ~{1-2min} until sandy. @@ -203,7 +203,7 @@ portions: 8 ## Lemon Curd ->&curd -[Whisk] In a #saucepan{}, the @lemon zest{1 tbsp}<@lemon, @lemon juice{120g}<@lemon{2}, @sugar{125% @&lemon juice}, and @eggs{3}. +[Whisk] In a #saucepan{}, @lemon zest{1 tbsp}<@lemon, @lemon juice{120g}<@lemon{2}, @sugar{125% @&lemon juice}, and @eggs{3}. [Cook] Over ^{medium heat} for ~{8min} until thickened. @@ -261,7 +261,7 @@ portions: 8 - **egg** (1) - **vanilla extract** (1/2 tsp) -1. **[Process]** In a *food processor*, the **flour** (180 g), **icing sugar** (55 g), and **salt** (1/4 tsp). +1. **[Process]** In a *food processor*, **flour** (180 g), **icing sugar** (55 g), and **salt** (1/4 tsp). 2. **[Crumble]** Add the **butter** (115 g) (cold, cut into small cubes) and mix for ⏲️ 1-2 min until sandy. 3. **[Combine]** Add the **egg** (1), **vanilla extract** (1/2 tsp) (optional) and mix until the dough comes together. 4. **[Rest]** Wrap in plastic wrap and let it rest in the fridge for ⏳ 1 h (passive). @@ -274,7 +274,7 @@ portions: 8 - **sugar** (125% of lemon juice) - **eggs** (3) -1. **[Whisk]** In a *saucepan*, the **lemon zest** (1 tbsp), **lemon juice** (120 g), **sugar** (125% of lemon juice), and **eggs** (3). +1. **[Whisk]** In a *saucepan*, **lemon zest** (1 tbsp), **lemon juice** (120 g), **sugar** (125% of lemon juice), and **eggs** (3). 2. **[Cook]** Over 🌡️ medium heat for ⏲️ 8 min until thickened. ### Baking the Tart Shell diff --git a/packages/docs/src/data/homepage-copy.ts b/packages/docs/src/data/homepage-copy.ts index 5452f3f0..1bb5011b 100644 --- a/packages/docs/src/data/homepage-copy.ts +++ b/packages/docs/src/data/homepage-copy.ts @@ -234,7 +234,7 @@ export const homepageCopy: Record<"en" | "fr", HomepageCopy> = { 2, ), - scaleInput: `## Country Loaf\n\n[Mix] The @*bread flour{400g}, @whole wheat flour{100g}, @water{75% @&bread flour}, @salt{2% @&bread flour}, and @levain{20% @&bread flour}.`, + scaleInput: `## Country Loaf\n\n[Mix] @*bread flour{400g}, @whole wheat flour{100g}, @water{75% @&bread flour}, @salt{2% @&bread flour}, and @levain{20% @&bread flour}.`, scaleOutput: JSON.stringify( { shopping_list: [