Module:Sandbox/Md gilbert/ListMaster explained

require('strict')

local p =

--printTable|style=[table|section]|display=[...]| }}--

function p.printTable(frame) -- Ensure the style is supported, defaults to table if frame.args.style ~= "table" and frame.args.style ~= "section" then frame.args.style = "table" end -- Ensure the display argument exists, return error otherwise if frame.args.display

nil then return "'display' argument is required in ListMaster invocation" end

-- Display either table or section, other styles can be added in the future local res = "" if frame.args.style

"table" then -- Print the table header res = res .. "

- \n" for col in string.gmatch(frame.args.display, "[^,]+") do res = res .. "! " .. p.firstToUpper(col) .. "\n" end elseif frame.args.style

"section" then end -- Then iterate over all the submodule items for k,v in ipairs(frame.args) do for mod in string.gmatch(v, "]+

}") do -- Add in the invocation text mod = "