Module:KnightspireLocation

From Knightspire Wiki
Revision as of 06:31, 9 May 2026 by Nex (talk | contribs) (Created page with "local p = {} function p.categorize(frame) local type = frame.args[1] local nation = frame.args[2] local out = "" if type == "Village" then out = out .. "Category:Villages" elseif type == "City" then out = out .. "Category:Cities" elseif type == "Town" then out = out .. "Category:Towns" elseif type == "Region" then out = out .. "Category:Regions" elseif type == "Dungeon" then out =...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Documentation for this module may be created at Module:KnightspireLocation/doc

local p = {}

function p.categorize(frame)
    local type = frame.args[1]
    local nation = frame.args[2]

    local out = ""

    if type == "Village" then
        out = out .. "[[Category:Villages]]"
    elseif type == "City" then
        out = out .. "[[Category:Cities]]"
    elseif type == "Town" then
        out = out .. "[[Category:Towns]]"
    elseif type == "Region" then
        out = out .. "[[Category:Regions]]"
    elseif type == "Dungeon" then
        out = out .. "[[Category:Dungeons]]"
    elseif type == "Landmark" then
        out = out .. "[[Category:Landmarks]]"
    else
        out = out .. "[[Category:Unclassified Locations]]"
    end

    if nation and nation ~= "" then
        out = out .. "[[Category:" .. nation .. " Locations]]"
    end

    return out
end

return p