Content deleted Content added
Tweaks to prepare for integration with Module:Navbox with columns/sandbox |
generalize 'navbox' function |
||
Line 39:
end
return hasSubArgs and p._navbox(subArgs) or listText
end▼
local function readArgs(args, prefix)▼
-- Read the arguments in the order they'll be output in, to make references▼
-- number in the right order.▼
local _▼
_ = args[prefix .. cfg.arg.title]▼
_ = args[prefix .. cfg.arg.above]▼
-- Limit this to 20 as covering 'most' cases (that's a SWAG) and because▼
-- iterator approach won't work here▼
for i = 1, 20 do▼
_ = args[prefix .. andnum('group', i)]▼
if inArray(cfg.keyword.subgroups, args[prefix .. andnum('list', i)]) then▼
for _, v in ipairs(cfg.keyword.subgroups) do▼
readArgs(args, prefix .. v .. i .. "_")▼
end▼
end▼
end▼
_ = args[prefix .. cfg.arg.below]▼
end
Line 704 ⟶ 685:
-- Template entry points
function p.navbox
▲ local function readArgs(args, prefix)
▲ _ = args[prefix .. andnum('group', i)]
▲ if inArray(cfg.keyword.subgroups, args[prefix .. andnum('list', i)]) then
▲ for _, v in ipairs(cfg.keyword.subgroups) do
▲ readArgs(args, prefix .. v .. i .. "_")
▲ end
▲ end
▲ end
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
local args = getArgs(frame, {wrappers = {cfg.pattern
readArgs(args, "")
return p['_'.
end
p['with collapsible groups'] = function (frame)
return p.navbox(frame, 'withCollapsibleGroups')
end
|