Module:Chronology

local p = {}; local albums = { ['The Smashing Pumpkins'] = { { title = 'Nothing Ever Changes', year = 1988 }, { title = 'The Smashing Pumpkins', year = 1989 }, { title = 'Moon Demo', year = 1989 }, { title = 'Gish', year = 1991 }, { title = 'Lull', year = 1991 }, { title = 'Peel Sessions', year = 1992 }, { title = 'Siamese Dream', year = 1993 }, { title = 'Siamese Singles', year = 1994 }, { title = 'Pisces Iscariot', year = 1994 }, { title = 'Mellon Collie and the Infinite Sadness', year = 1995 }, { title = 'The Aeroplane Flies High', year = 1996 }, { title = 'Adore', year = 1998 }, { title = 'Machina/The Machines of God', year = 2000}, { title = 'Machina II/The Friends & Enemies of Modern Music', year = 2000 }, { title = 'Live at Cabaret Metro 10-5-88', year = 2000 }, { title = 'Rotten Apples', year = 2001 }, { title = 'Judas O', year = 2001 }, { title = 'Rarities and B-Sides', year = 2005 }, { title = 'Zeitgeist', year = 2007 }, { title = 'American Gothic', year = 2007 }, { title = 'Teargarden by Kaleidyscope', year = 2009 }, { title = 'Oceania', year = 2011 }, { title = 'Monuments to an Elegy', year = 2014 }, { title = 'Shiny and Oh So Bright, Vol. 1 / LP: No Past. No Future. No Sun.', year = 2018 } } }

function p.main(artist, title) for i, subject in ipairs(albums) do		if title == subject.title then local wikitext = "{| style='background: transparent; width: 100%; min-width: 100%; border-collapse: collapse" wikitext = wikitext .. "|- style='line-height: 1.4em;'" wikitext = wikitext .. "| style='width: 33%; text-align: center; vertical-align: top; padding: .2em .1em .2em 0'" wikitext = wikitext .. "| "			mw.log(wikitext) if i > 1 then wikitext = wikitext .. "" .. albums[i - 1].title .. " (" .. albums[i - 1].year .. ")" end wikitext = wikitext .. "| style='width: 33%; text-align: center; vertical-align: top; padding: .2em .1em' " wikitext = wikitext .. "| '" .. title .. "' (" .. subject.year .. ")" wikitext = wikitext .. "| style='width: 33%; text-align: center; vertical-align: top; padding: .2em 0 .2em .1em' " if albums[i + 1] ~= nil then wikitext = wikitext .. "| ''" .. albums[i + 1].title .. "'' (" .. albums[i + 1].year .. ")" end

return wikitext .. "|}"		end end return "Unknown album! Please update Module:Chronology" end

return p