Module:template: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 3: Line 3:
local function make_template(frame, nested)
local function make_template(frame, nested)
local args = (frame:getParent() and frame:getParent().args) or frame.args
local args = (frame:getParent() and frame:getParent().args) or frame.args
local out = {"&#123;&#123;", (nested and "<code>") or "", frame.args[1]}
local out = {"&#123;&#123;", (nested and "<code>") or "", args[1]}
local i = 2
local i = 2
while frame.args[i] do
while args[i] do
table.insert(out, "&#124;" .. frame.args[i])
table.insert(out, "&#124;" .. args[i])
i = i + 1
i = i + 1
end
end
for key, value in ipairs(frame.args) do
for key, value in ipairs(args) do
if type(key) == "string" then
if type(key) == "string" then
table.insert(out, "&#124;" .. key .. "=" .. value)
table.insert(out, "&#124;" .. key .. "=" .. value)

Navigation menu