Module: Tl: Difference between revisions
From A Wiki of Ice and Fire
No edit summary |
No edit summary |
||
| Line 8: | Line 8: | ||
local output = '{{[[Template:' .. template .. '|' .. template .. ']]' | local output = '{{[[Template:' .. template .. '|' .. template .. ']]' | ||
for key, value in pairs(args) do | for key, value in pairs(args) do | ||
if key ~= 1 | if key ~= 1 then | ||
value = value or '' | |||
if lang:parseFormattedNumber(key) == nil then | |||
output = output .. '|' .. key .. '=' .. value | |||
else | |||
output = output .. '|' .. value | |||
end | |||
end | end | ||
end | end | ||
Revision as of 13:39, 5 November 2022
Documentation for this module may be created at Module:Tl/doc
local getArgs = require('Module:Arguments').getArgs
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