Jump to content

Module:Recipe/doc

From SankoQuest Wiki
Revision as of 17:17, 5 July 2026 by GrizzledAlchemistb40f9cb5 (talk | contribs) (module documentation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is the documentation page for Module:Recipe

This is the documentation page for Module:Recipe.

Renders the visual recipe box (div.sanko-recipe) shown by Template:Recipe: a row of metadata pills, up to six input item slots, an arrow, and an output slot. Item slots are drawn by Module:InventorySlot (required, via _slot).

This module is display-only. The Cargo storage for recipes (a Recipes row, plus RecipeIngredients/RecipeOutputs rows stored via Template:RecipeIngredient and Template:RecipeOutput) is handled by the wikitext of Template:Recipe itself, not here.

Functions

box

Called from Template:Recipe as {{#invoke:Recipe|box}} with no explicit arguments: each parameter is taken from frame.args when present there, otherwise from the parent frame's (i.e. the template call's) arguments; a value that is missing or empty after that lookup falls back to the default. (A parameter set to an empty string in frame.args does not fall through to the parent frame — the parent is only consulted when the key is absent.)

Parameter Meaning Default
recipe_kind Pill text; also switches output rendering (see below). Crafting
station, skill, element Rendered as pills when non-empty. omitted
level_req, xp, base_max_hit Rendered as "Level N", "N XP", "Max hit N" pills when non-empty. omitted
input1input6 Input item names; each non-empty one becomes an inventory slot. omitted
input1_qtyinput6_qty Quantity for the matching input. 1
output (fallback output_item) Output item name.
output_qty Output quantity. 1

Used by

  • Template:Recipe — the invocation is the last piece of the template, after its #cargo_store calls. Articles use the template, e.g. from Air Missile:
{{Recipe
|recipe_id=spell_air_missile
|recipe_kind=Spell
|output=Air Missile
|output_qty=1
|station=Spellbook
|skill=Magic
|level_req=1
|xp=
|element=air
|base_max_hit=2
|source=SankoQuest game data
|verification_status=Needs gameplay verification
|input1=Air Shard
|input1_qty=1
|input2=Spirit Shard
|input2_qty=1
}}

(source and verification_status are consumed by Template:Recipe's Cargo rows, not by this module.)

Notes and sharp edges

  • When recipe_kind is exactly Spell (case-sensitive), the output is rendered as text in div.sanko-spell-output instead of an item slot, with a small xN suffix when output_qty is not 1 — useful for outputs that are not inventory items.
  • Only six input slots exist; input7 and beyond are ignored.
  • The arrow () and the output area render even when inputs or output are empty, so a bare invocation still produces a (mostly empty) box.
  • Input/output item names must match keys in Module:Sprite/Item or their slots show the missing-sprite ? placeholder.