Module:Infobox song

local p = {}

function p._track_listing(song, album) local cargo = mw.ext.cargo local results = cargo.query(		'track_listings',		'track, song, song_page_title',		{			where = 'work = "' .. album .. '" AND main_listing = 1',			orderBy = 'track_listings._ID ASC'		}	)

local root = mw.html.create local tableRoot = root:tag('table')

for r = 1, #results do		local row = tableRoot:tag('tr') local result = results[r] row:tag('td'):wikitext(result['track']) row:tag('td'):wikitext( .. result['song'] .. ) end

return tostring(root) end

function p.track_listing(frame) local song = frame.args[1] local album = frame.args[2] return p._track_listing(song, album) end

return p