Template:Tl: Difference between revisions

From Forsaken Saga Wiki
(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...")
 
No edit summary
 
Line 1: Line 1:
local getArgs = require('Module:Arguments').getArgs
<includeonly>{{#tag:code|{{#invoke:Tl|main}}}}</includeonly><noinclude>
local lang = mw.getContentLanguage()
{{documentation}}
 
[[Category:Templates]]
local p = {}
</noinclude>
 
function p.main(frame)
    local args = getArgs(frame)
    local template = args[1]
    local output = '&#123;&#123;[[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 .. '&#124;' .. key .. '=' .. value
            else
                output = output .. '&#124;' .. value
            end
        end
    end
    local output = output .. '&#125;&#125;'
    return output
end
 
return p

Latest revision as of 01:21, 28 May 2024

Template documentation[create]