2,788
edits
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 = {"{{", (nested and "<code>") or "", | local out = {"{{", (nested and "<code>") or "", args[1]} | ||
local i = 2 | local i = 2 | ||
while | while args[i] do | ||
table.insert(out, "|" . | table.insert(out, "|" .. args[i]) | ||
i = i + 1 | i = i + 1 | ||
end | end | ||
for key, value in ipairs( | for key, value in ipairs(args) do | ||
if type(key) == "string" then | if type(key) == "string" then | ||
table.insert(out, "|" .. key .. "=" .. value) | table.insert(out, "|" .. key .. "=" .. value) |