Fix Templating documentation

Fix bad variable naming in docs
This commit is contained in:
Alexander Rose 2021-11-06 17:39:23 +01:00 committed by GitHub
parent 699edb6579
commit 0ab21f9941
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ from recipe scaling.
Currently the only available variable in the Templating context is `ingredients`.
`ingredients` is an array that contains all ingredients of the current recipe step. You can access an ingredient by using
`{{ ingredient[<index in list>] }}` where the index refers to the position in the list of ingredients starting with zero.
`{{ ingredients[<index in list>] }}` where the index refers to the position in the list of ingredients starting with zero.
You can also use the interaction menu of the ingredient to copy its reference.
!!! warning
@ -28,10 +28,10 @@ You can also use the interaction menu of the ingredient to copy its reference.
You can also access only the amount, unit, note or food inside your instruction text using
```
{{ instructions[0].amount }}
{{ instructions[0].unit }}
{{ instructions[0].food }}
{{ instructions[0].note }}
{{ ingredients[0].amount }}
{{ ingredients[0].unit }}
{{ ingredients[0].food }}
{{ ingredients[0].note }}
```
## Technical Reasoning
@ -43,4 +43,4 @@ The template could access them by ID, the food name or the position in the list.
2. **Name**: very nice to read and easy but does not work when a food occurs twice in a step. Could have workaround but would then be inconsistent.
3. **Position**: easy to write and understand but breaks when ordering is changed and not really nice to read when instructions are not rendered.
I decided to go for the position based system. If you know of any better way feel free to open an issue or PR.
I decided to go for the position based system. If you know of any better way feel free to open an issue or PR.