Module:Chronology

local p = {}; local data = { ['The Smashing Pumpkins'] = { ['albums'] = { { title = 'Nothing Ever Changes', year = 1988 }, { title = 'The Smashing Pumpkins', year = 1989, link = 'The Smashing Pumpkins (album)' }, { 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 } },		['singles'] = { { title = 'I Am One', year = 1990 }, { title = 'Tristessa', year = 1990 }, { title = 'Siva', year = 1991 }, { title = 'Rhinoceros', year = 1991 }, { title = 'Drown', year = 1992 }, { title = 'Cherub Rock', year = 1993 }, { title = 'Today', year = 1993 }, { title = 'Disarm', year = 1994 }, { title = 'Rocket', year = 1994 }, { title = 'Bullet with Butterfly Wings', year = 1995 }, { title = '1979', year = 1996 }, { title = 'Zero', year = 1996 }, { title = 'Tonight, Tonight', year = 1996 }, { title = 'Muzzle', year = 1996 }, { title = 'Thirty-Three', year = 1996 }, { title = 'Eye', year = 1997 }, { title = 'The End Is the Beginning Is the End', year = 1997 }, { title = 'Ava Adore', year = 1998 }, { title = 'Perfect', year = 1998 }, { title = 'Crestfallen', year = 1998 }, { title = 'The Everlasting Gaze', year = 1999 }, { title = 'Stand Inside Your Love', year = 2000 }, { title = 'I of the Mourning', year = 2000 }, { title = 'Try, Try, Try', year = 2000 }, { title = 'Untitled', year = 2000 }, { title = 'Tarantula', year = 2007 }, { title = "That's the Way (My Love Is)", year = 2007 }, { title = 'G.L.O.W.', year = 2008 }, { title = 'Freak', year = 2010 }, { title = 'Owata', year = 2011 }, { title = 'The Celestials', year = 2012 }, { title = 'Panopticon', year = 2012 } }	},	['Billy Corgan'] = { ['albums'] = { { title = 'TheFutureEmbrace', year = 2005 }, { title = 'Ogilala', year = 2017 }, { title = 'Cotillions', year = 2019 } }	},	['James Iha'] = { ['albums'] = { { title = 'Let It Come Down', year = 1998 }, { title = 'Look to the Sky', year = 2012 } }	},	['Jimmy Chamberlin Complex'] = { ['albums'] = { { title = 'Life Begins Again', year = 2005 }, { title = 'The Parable', year = 2017 } }	},	['Tribute'] = { ['albums'] = { { title = 'Ghost Children: A Tribute To The Smashing Pumpkins', year = 2001 }, { title = 'Ghost Children/Friends and Enemies', year = 2006 }, { title = 'MySpace Smashing Pumpkins Tribute', year = 2007 } }	} }

local function entry(row, kind, current) local formatting = "''" -- For albums if kind == 'singles' then formatting = '"'	end	if current then		formatting = formatting .. "'''"	end	local link = row.title	if row.link ~= nil then		link = row.link .. "|" .. row.title	end	return formatting .. "" .. link .. "" .. formatting .. " (" .. row.year .. ")" end

function p.main( frame ) local artist = frame.args[1] local kind = frame.args[2] local title = frame.args[3] local albums = data[artist][kind] 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 .. "\n|- style='line-height: 1.4em;'" wikitext = wikitext .. "\n| style='width: 33%; text-align: center; vertical-align: top; padding: .2em .1em .2em 0' |" if i > 1 then wikitext = wikitext .. entry(albums[i - 1], kind, false) end wikitext = wikitext .. "\n| style='width: 33%; text-align: center; vertical-align: top; padding: .2em .1em' |" wikitext = wikitext .. entry(subject, kind, true) wikitext = wikitext .. "\n| style='width: 33%; text-align: center; vertical-align: top; padding: .2em 0 .2em .1em' |" if albums[i + 1] ~= nil then wikitext = wikitext .. entry(albums[i + 1], kind, false) end

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

return p