Module:Tl

From Forsaken Saga Wiki
Revision as of 01:22, 28 May 2024 by Harrigton (talk | contribs) (Created page with "local getArgs = require('Module:Arguments').getArgs local lang = mw.getContentLanguage() local p = {} function p.main(frame) local args = getArgs(frame) local template = args[1] local output = '{{' .. template .. '' for key, value in pairs(args) do if key ~= 1 then value = value or '' if lang:parseFormattedNumber(key) == nil then output = output .. '|' .. key...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

local getArgs = require('Module:Arguments').getArgs
local lang = mw.getContentLanguage()

local p = {}

function p.main(frame)
    local args = getArgs(frame)
    local template = args[1]
    local output = '{{[[Template:' .. template .. '|' ..  template .. ']]'
    for key, value in pairs(args) do
        if key ~= 1 then
            value = value or ''
            if lang:parseFormattedNumber(key) == nil then
                output = output .. '|' .. key .. '=' .. value
            else
                output = output .. '|' .. value
            end
        end
    end
    local output = output .. '}}'
    return output
end

return p