Module:List Pages

local p = {}

local utilsArg = require("Module:UtilsArg") local utilsMarkup = require("Module:UtilsMarkup") local utilsTable = require("Module:UtilsTable")

local function notEmpty(s) return s ~= nil and s ~= "" end

function p.Main(frame) local args = utilsTable.merge(frame.args, frame:getParent.args) return p.main(args) end

function p.main(args) local default = args.default local pages = utilsTable.ivalues(args) pages = utilsTable.filter(notEmpty)(pages) if #pages == 0 then return default end pages = utilsTable.map(mw.text.trim)(pages) pages = utilsTable.map(utilsMarkup.link)(pages) local pageList = mw.text.listToText(pages) return pageList end

return p