Module:KnightspireLocation: Difference between revisions

From Knightspire Wiki
Jump to navigationJump to search
Content deleted Content added
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 =..."
 
No edit summary
 
Line 19: Line 19:
elseif type == "Landmark" then
elseif type == "Landmark" then
out = out .. "[[Category:Landmarks]]"
out = out .. "[[Category:Landmarks]]"
else
out = out .. "[[Category:Unclassified Locations]]"
end

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



Latest revision as of 06:37, 9 May 2026

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]]"
    end

    return out
end

return p