Module:EpisodeList

local list_article = { ['Digimon Adventure'] = "List of Digimon Adventure episodes", ['Digimon Adventure 02'] = "List of Digimon Adventure 02 episodes", ['Digimon Tamers'] = '', ['Digimon Frontier'] = '', ['Digimon Data Squad'] ='', ['Digimon Fusion'] = '', ['Digimon Adventure tri.'] = '', ['Digimon Universe: Appli Monsters'] = '', ['Digimon Movie'] = '' }

local category = { ['Digimon Adventure'] = "Digimon Adventure episodes", ['Digimon Adventure 02'] = "Digimon Adventure 02 episodes", ['Digimon Tamers'] = 'Digimon Tamers episodes', ['Digimon Frontier'] = 'Digimon Frontier episodes', ['Digimon Data Squad'] ='', ['Digimon Fusion'] = '', ['Digimon Adventure tri.'] = '', ['Digimon Universe: Appli Monsters'] = '', ['Digimon Movie'] = '' }

local episodelist = { ['Digimon Adventure'] = "01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 51 - 52 - 53 - 54", }

local prev_series = { ['Digimon Adventure 02'] = {"And so it begins...", "Digimon Adventure"}, }

local next_series = { ['Digimon Adventure'] = {"Enter Flamedramon", "Digimon Adventure 02"}, }

local appendices_pre = { ['Digimon Adventure'] = "Digimon Adventure", ['Digimon Adventure 02'] = "List of Digimon Adventure 02 episodes", ['Digimon Tamers'] = '', ['Digimon Frontier'] = '', ['Digimon Data Squad'] ='', ['Digimon Fusion'] = '', ['Digimon Adventure tri.'] = '', ['Digimon Universe: Appli Monsters'] = '', }

episode_table = { ['episodelist'] = episodelist, ['list_article'] = list_article, ['prev_series'] = next_series, ['next_series'] = next_series, ['appendices_pre'] = appendices, }

-- Libraries of functions --

-- stands for High Frequency local HF = mw.InfoboxBuilderHF -- Parses invocation parameters, trims whitespace, and removes blanks. local getArgs = require('Dev:Arguments').getArgs -- Outputs various kinds of lists. local L = require('Dev:List') -- Gives the name of the current page. It's expensive, so we only do it once. -- The _G then makes it global, available to all page functions. _G.vars = { Pagename = mw.title.getCurrentTitle.text } -- -- Public functions (called from a Template or article) -- -- -- There is no standalone template, so no public functions.

-- Internal functions (used in this and other Modules --

function episodelist:validseason( name ) if type( self[ name ] ) == 'string' then return true else return nil end end

function episodelist:makeList( name ) if self:validseason ( name ) then -- local episodes = mw.text.split( self[name], ' · ' ) -- return L.makeList( 'horizontal', episodes ) return self[name] else return nil end end

function appendices_pre:validseason( name ) if type( self[ name ] ) == 'string' then return true else return nil end end

function appendices_pre:subst( name, episode ) local appendix = {} local parts = { ['left'] = ,       ['right'] = , ['cast'] = '/Appendices/Cast/Episode ', ['analyzer'] = '/Appendices/Analyzer/Episode ', ['digivolutions'] = '/Appendices/Digivolutions/Episode ', ['attacks'] = '/Appendices/Attacks/Episode ', ['locations'] = '/Appendices/Locations/Episode ', }   if type(episode) == 'number' then episode = string.format('%02d', episode) else episode = episode end if self:validseason( name ) then table.insert( appendix,     parts[left]..      self[name]..parts[cast]..episode..'|Cast'..      parts[right]     ) if mw.title.new( self[name]..parts[analyzer]..episode ).exists == true then table.insert( appendix,      parts[left]..       self[name]..parts[analyzer]..episode..'|Analyzer'..       parts[right]      ) end if mw.title.new( self[name]..parts[digivolutions]..episode ).exists == true then table.insert( appendix,      parts[left]..       self[name]..parts[digivolutions]..episode..'|Digivolutions'..       parts[right]      ) end if mw.title.new( self[name]..parts[attacks]..episode ).exists == true then table.insert( appendix,      parts[left]..       self[name]..parts[attacks]..episode..'|Attacks'..       parts[right]      ) end if mw.title.new( self[name]..parts[locations]..episode ).exists == true then table.insert( appendix,      parts[left]..       self[name]..parts[locations]..episode..'|Locations'..       parts[right]      ) end return L.makeList( 'horizontal', appendix ) elseif name == '' then else return nil end end - -- Output (send it back to whatever called it) -- - return episode_table