local getArgs = require('Module:Arguments').getArgs
p =
local function add_header_row(frame, tbl, text) local row = tbl:tag('tr') row:tag('th') :attr('colspan', '2') :wikitext(text)end
local function edit(frame, pagename) return frame:expandTemplateend
local function add_template_row(frame, tbl, pagename) local row = tbl:tag('tr') row:tag('td') :wikitext(frame:expandTemplate) row:tag('td') :wikitext(edit(frame, 'Template:' .. pagename))end
local function add_wikilink_row(frame, tbl, pagename, text, right) local row = tbl:tag('tr') row:tag('td') :wikitext('' .. (text or pagename) .. '') row:tag('td') :wikitext(right or edit(frame, pagename))end
local function add_section(frame, args, tbl, add_section_header, arg_prefix, page_prefix, row_function) if row_function
'string' then local num = k:match('^' .. arg_prefix .. '(%d+)$') if num then table.insert(nums, tonumber(num)) end end end if #nums
local function main(frame) local args = getArgs(frame) local tbl = mw.html.create('table') :cssText('clear: right; float:right; border:1px navy solid;') tbl:tag('caption') :wikitext('Portal toolbox') add_header_row(frame, tbl, 'Main portal page') local rootTitle = mw.title.getCurrentTitle.rootPageTitle.subjectPageTitle add_wikilink_row(frame, tbl, rootTitle.fullText) add_section(frame, args, tbl, 'Static subpages', 'static', rootTitle.fullText .. '/') add_section(frame, args, tbl, 'Dynamic subpages', 'dynamic', rootTitle.fullText .. '/') add_section(frame, args, tbl, 'Templates', 'template', , add_template_row) add_section(frame, args, tbl, 'Other', 'other', ) return tblend
p.main = main
return p