-- This module implements .
local itemHeadings = mw.loadData('Module:Tasks/headings')
local p =
function p.main(frame) local origArgs = frame:getParent.args local args = for k, v in pairs(origArgs) do if v ~= then args[k] = v end end return p.luaMain(args)end
function p.luaMain(args) -- Make an array of list items. local items = for k, v in pairs(args) do local heading = itemHeadings[k] if heading then items[#items + 1] = end end table.sort(items, function (t1, t2) local key1 = t1.key local key2 = t2.key if key1
-- Add the "other" argument to the list item array. if args.other then table.insert(items,) end
-- Make the list wikitext. local list = mw.html.create('ul') list :css if args.listclass then list:addClass(args.listclass) end for i, t in ipairs(items) do list:tag('li'):wikitext(string.format("%s:\n%s", t.heading, t.content )) end list = tostring(list) -- Make the surrounding div tags. local listDiv = mw.html.create('div') listDiv :css :wikitext("Here are some " .. "tasks you can do:" ) :newline :wikitext(list) listDiv = tostring(listDiv)
-- Construct the wikitable. local image if args.image
' end local tableFormat = style="background:none;width:auto;"| style="vertical-align:top" |%s|%s|} return string.format(tableFormat, image, listDiv)end
return p