From Arms of God Wiki

Revision as of 16:04, 10 June 2026 by Ta1ha (talk | contribs) (bot: documentation pass — editor-facing docs (data descriptions, module comments, template usage, Help rewrite))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Renders Weapons records from Data:Weapons.json on index and detail pages.

  • infobox — infobox for one record (used via Template:Weapons infobox)
  • index — sortable index table on Weapons
  • body / crossRefs — per-section renderers invoked from detail pages

Bot-published: the module and its Data: page are regenerated on re-publish. Restyle via the per-section templates rather than editing page wikitext.


-- Module:Weapons — the Weapons category module.
--
-- WHAT IT DOES
--   Renders Weapons infoboxes, body sections, cross-references and the
--   category index. This module is intentionally tiny: it only binds
--   the category name and forwards to Module:Core, which computes
--   everything from the source Data:Weapons.json at render time (see
--   that Data page's own `description` for the record fields, and
--   Help:Wiki Editing for the architecture guide). To change HOW
--   Weapons pages render, edit Module:Core; to change the DATA, edit
--   Data:Weapons.json.
local Core = require('Module:Core')
local p = {}
local CAT = 'Weapons'

-- {{#invoke:Weapons|infobox|id=<slug-or-id>}}
function p.infobox(frame) return Core.infoboxEntry(CAT, frame) end

-- {{#invoke:Weapons|body|id=<slug-or-id>[|section=<name>]}}
function p.body(frame) return Core.bodyEntry(CAT, frame) end

-- {{#invoke:Weapons|crossRefs|id=<slug-or-id>}}
function p.crossRefs(frame)
  return require('Module:CrossRef').entry(CAT, frame)
end

-- {{#invoke:Weapons|index}} — the category index table
function p.index(frame) return Core.indexEntry(CAT, frame) end

-- {{#invoke:Weapons|render|id=<slug-or-id>}} — combined fallback
function p.render(frame) return Core.renderEntry(CAT, frame) end

return p