You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide-extensions.md
+44-1Lines changed: 44 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,12 +96,55 @@ When referencing ingredients, the added quantities will be converted to [Decimal
96
96
```
97
97
98
98
Also works with Cookware and Timers
99
-
99
+
100
100
## Cookware quantities
101
101
102
102
- Cookware can also be quantified (without any unit, e.g. `#bowls{2}`)
103
103
- Quantities will be added similarly as ingredients if cookware is referenced, e.g. `#&bowls{2}`
104
104
105
+
## Alternative units
106
+
107
+
You can define equivalent quantities in different units for the same ingredient using the pipe `|` separator within the curly braces.
108
+
109
+
Usage: `@flour{100%g|3.5%oz}`
110
+
111
+
This is useful for providing multiple units (e.g. metric and imperial) simultaneously for the same ingredient. The first unit is considered the primary unit.
112
+
113
+
## Ingredient alternatives
114
+
115
+
### Inline alternatives
116
+
117
+
You can specify alternative ingredients directly in the ingredient syntax using pipes: `@baseName{quantity}|altName{altQuantity}[note]|...`
118
+
119
+
This allows users to select from multiple alternatives when computing recipe quantities.
-`@sugar{100%g}|brown sugar{100%g}[for a richer flavor]`
124
+
125
+
When inline alternatives are defined, the recipe's [`choices`](/api/interfaces/RecipeChoices) property will be populated. You can then use the `calc_ingredient_quantities()` method to compute quantities corresponding to the user's choices.
126
+
127
+
All modifiers (`&`, `-`, `?`) work with inline alternatives:
Ingredients can also have alternatives by grouping them with the same group key using the syntax: `@|groupKey|ingredientName{}`
133
+
134
+
This is useful when you want to provide alternative choices in your recipe text naturally:
135
+
136
+
Use cases:
137
+
-`Add @|milk|milk{200%ml} or @|milk|almond milk{100%ml} or @|milk|oat milk{150%ml} for a vegan version`
138
+
-`Add some @|spices|salt{} or maybe some @|spices|pepper{}`
139
+
140
+
When grouped alternatives are defined, the recipe's [`choices`](/api/interfaces/RecipeChoices) property will be populated with available alternatives for each group. You can then use the `calc_ingredient_quantities()` method to compute quantities corresponding to the user's choices.
141
+
142
+
All modifiers (`&`, `-`, `?`) work with grouped alternatives:
143
+
```
144
+
Add @|flour|&flour tipo 00{100%g} or @|flour|flour tipo 1{50%g}
145
+
Add @|spices|-salt{} or @|spices|?pepper{}
146
+
```
147
+
105
148
## Ingredient aliases
106
149
107
150
-`@ingredientName|displayAlias{}` will add the ingredient as "ingredientName" in the ingredients list, but will display is as "displayAlias" in the preparation step.
0 commit comments