Module:Subpages 2

-- subpages = require('Module:Subpages).subpages -- for page in subpages('Page') do ... end

local sp = {}

function sp.subpages( frame ) page = frame.args[1] allsp = frame:callParserFunction('SUBPAGES', { page, sep = "~" }) links = {} for i in string.gmatch(allsp, "[^~]+") do table.insert(links, "" .. i .. "%n%n") end return table.concat(links) end

return sp