Module:Wd: Difference between revisions

Content deleted Content added
Overhauled module structure; replaced 'single' flag with separate commands (functions), added separate 'reference(s)' command
No edit summary
Line 1,510:
end
 
function p._label(args, _)
_ = _ or Config.new()
_.curState = State.new(_)
Line 1,624:
end
 
function p._title(args, _)
_ = _ or Config.new()
_.pageTitle = true
return p._label(args, _)
Line 1,632:
-- main function that may be used by wrapper templates
function p.main(frame)
local f, args, i, v
frame = frame:getParent() or frame
Line 1,638:
assert(p[f], 'The function "' .. f .. '" does not exist')
frame.args = table.remove(frame.args, 1)
args = {}
for i, v in ipairs(frame.args) do
if i > 1 then
args[i-1] = v
end
end
frame.args = args
return p[f](frame)