Module:Development versions

local p = {} p.list = function( f ) local args = f:getParent.args local version = args[1] or mw.title.getCurrentTitle.rootText f:callParserFunction ( '#dplvar:set', 'parentVersion', version ) local categories = args.categories or 'snapshots, pre-releases' local devVersions = {} for category in mw.text.gsplit( categories, '%s*,%s*' ) do		table.insert( devVersions,			f:callParserFunction( '#dpl', { category = version .. ' ' .. category, format = ',|%PAGE%', suppresserrors = 'true' } )		)	end devVersions = mw.text.trim( table.concat( devVersions ), '%s|' ) local content = {} for v in mw.text.gsplit( devVersions, '|' ) do		local wikitext = mw.title.new( v ):getContent if not wikitext:match( ' ' ) then wikitext = ' ' .. wikitext .. ' '		end table.insert( content, ' =' .. v .. '= ' .. wikitext ) end content = table.concat( content ) :gsub( '^.- %s*', '\n' ) :gsub( '%s* .- %s*', '\n' ) :gsub( '%s* .*$', '\n' ) :gsub( '\n(=+ *[^\n]+ *=+)', '\n=%1=' ) return f:preprocess( mw.text.trim( content ) ) end return p