Template:Recipe/doc

From Against the Storm Official Wiki
< Template:Recipe
Revision as of 23:19, 12 February 2023 by Aeredor (talk | contribs) (separated the documentation page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This template calls renderRecipe in Module:RenderRecipe to get recipes for a product and/or a building. This will generate a new wikitable full of content from the game: buildings, stars of efficiency, ingredients, and products.

This template standardizes the display of recipes throughout this wiki and greatly simplifies the amount of writing that is necessary when adding new content pages, especially for resources and buildings.


Usage

The table will contain exactly one recipe if the template is given both a product and building. The table will (usually) contain more than one row if the template is given either a product or a building. If nothing is provided, for example {{Recipe}}, an error will appear instead.

Here are ways to call the template, as they would be written in the article calling the template:

Argument Examples Expected outcome
None {{Recipe}} An error
Product and building {{Recipe|Crystalized Dew|Brickyard}}
{{Recipe|product=Crystalized Dew|building=Brickyard}}
A table with one row.
Product only {{Recipe|Pie}}
{{Recipe|product=Pie}}
A table with several rows, one for each building in which Pie can be produced.
Building only {{Recipe||Scribe}} (note the double pipe)
{{Recipe|building=Scribe}}
A table with several rows, one for each product that can be produced in the Scribe.


Examples

The following are generated by calling the template, as shown in the examples in the table above.

{{Recipe}} yields:

Unknown parameter in Recipe template.


{{Recipe|Crystalized Dew|Brickyard}} yields:

1 recipe in the Brickyard for Crystalized Dew.
BuildingEfficiencyIngredient #1Ingredient #2Ingredient #3Product

00:42
3
3
3
3
4
4
10
14
18
2


{{Recipe|Pie}} yields:

2 recipes for Pie.
BuildingEfficiencyIngredient #1Ingredient #2Product
★★
02:06
6
4
4
4
4
4
10
Pie Pie
★★
02:06
6
4
4
4
4
4
10
Pie Pie
★★★
01:45
6
3
3
3
3
3
10
Pie Pie


{{Recipe||Scribe}} yields:

3 recipes in the Scribe.
BuildingEfficiencyIngredient #1Ingredient #2Product
★★★
01:03
2
2
6
1
1
8
★★
02:06
5
5
3
2
3
10
Ale Ale

01:30
10
3
4
4
2