Documentation for this module may be created at Module:Pagelist/doc

function links( frame )
	if frame.args.list == nil then
		return ''
	end
	local list = frame.args.list
	local items = mw.text.split( list, ';', true )
	local outItems = {}
	for i,item in pairs( items ) do
		if item == nil or item == '' then
			return
		end
		outItems[i] = '[[' .. item .. ']]'
		if frame.args.preload ~= nil then
			local title = mw.title.new( item )
			if title == nil or not title.exists then
				local editUrl = title:canonicalUrl( { action = 'edit', preload = 'Template:' .. frame.args.preload .. '/preload' } )
				-- Replace the link in outItems.
				outItems[i] = item .. ' ([' .. editUrl .. ' create])'
			end
		end
	end
	if frame.args.prose ~= nil then
		return  mw.text.listToText( outItems, ', ', ' and ' )
	else
		return table.concat( outItems, " · " )
	end
end

return {
	links = function( frame ) return links( frame ) end;
}