440
edits
(allow this to work for numbers) |
m (11 revisions imported from wikipedia:Module:Template_invocation) |
||
(6 intermediate revisions by 5 users not shown) | |||
Line 41:
-- name and the arguments given. Note that it isn't
-- perfect: we have no way of knowing what whitespace was
-- in the original invocation, the
--
-- will be removed.
-- Parameters: name - the template name, formatted as it will appear
Line 101:
invArgs[k] = nil -- Erase the key so that we don't add the value twice
end
local invArgs_list = {} -- sort a parameter list; preferable to randomly sorted output
for k, v in pairs(invArgs) do
invArgs_list[#invArgs_list + 1] = k
end
table.sort(invArgs_list)
for i, v in ipairs(invArgs_list) do -- Add named args based on sorted parameter list
ret[#ret + 1] = seps.pipe
ret[#ret + 1] = k▼
ret[#ret + 1] = seps.equals▼
ret[#ret + 1] = v
▲ ret[#ret + 1] = seps.equals
end
ret[#ret + 1] = seps.closeb
|