Module:POTD transcluder

local p = {}

function p.transclude( frame ) local page = frame.args[1] or error( 'No page was specified' ) local wikitext = mw.title.new( page ):getContent if wikitext == nil then return '' .. page .. ' does not exist' end local n = string.match( wikitext, '^' ) if n == nil then n = string.match( wikitext, '^' ) end if n == nil then return frame:expandTemplate{ title = page, args = { 'row' } } end local t = {} for i = 1, tonumber( n ) do t[i] = frame:expandTemplate{ title = page .. '/' .. i, args = { 'row' } } end return table.concat( t, "\n" ) end

return p