Module:GameInfo/doc
More actions
This is the documentation page for Module:GameInfo
Module:GameInfo is the stable entrypoint for SpiritVale “GameInfo” renderers (Phase 4.1).
Contract
Pages are generated/updated by SVWT + pywikibot (compiled artifacts).
This module reads arguments from frame.args only (no parent-frame wrappers).
Submodules are pure renderers and must export render(frame).
Entry points
{{#invoke:GameInfo|Skills|id=...|index=...|notes=...|data=...}}
{{#invoke:GameInfo|Category|name=Skills|...}}
The Category router is allowlist-only. Users cannot force arbitrary require() targets.
Routing
GameInfo routes only to modules listed in the internal allowlist. Currently supported:
- Skills → Module:GameInfo/Skills
TemplateStyles
GameInfo always emits one TemplateStyles tag per invocation. Default CSS:
Module:GameInfo/styles.css
Submodules may override by setting:
STYLE_SRC = "Module:GameInfo/skills.css"
Shared scaffolding
Args helpers
arg(frame, key, fallback)trims and returns a string.int(frame, key, fallback, min, max)clamps integers.bool(frame, key, fallback)supports 1/0, true/false, yes/no.
= Container builder
box(opts) creates the canonical card shell:
- root:
div.sv-gi-card - top:
div.sv-gi-top - bottom:
div.sv-gi-bottom
Data attributes:
data-gi="1"data-gi-phase="4.1"data-level,data-max-level
Optional:
id(orroot_id)variantadds classsv-gi--<variant>
Convenience renderer
render_box(opts) builds the box and fills top/bottom with either HTML nodes or wikitext.
Error handling
If a route cannot be loaded or throws, GameInfo returns TemplateStyles plus a wiki-friendly error box:
div.sv-gi-error
Debug / wiring test
A simple sanity check exists:
{{#invoke:GameInfo|skeleton|id=sv-gi-test-1|level=1|max=10|variant=skills}}