Module:Main

-- This module implements Template:Main.

local p = {}

function p._main(args) local links = {} for i, v in ipairs(args) do		links[i] = string.format(			'%s',			v,			args['l' .. i] or v		) end local prefix if #links > 1 then prefix = 'Main articles' else prefix = 'Main article' end links = mw.text.listToText(links) return string.format(		': %s: %s ',		prefix, links	) end

function p.main(frame) local args = {} for k, v in pairs(frame:getParent.args) do		v = v:match('^%s*(.-)%s*$') -- trim whitespace if v ~= '' then args[k] = v		end end return p._main(args) end

return p