end
end  
return onInitialPage
end  
-- Local function which does the actual main process.
local function _main(args, sublist)
local title = mw.title.getCurrentTitle
local pageTitle = title.text
local initiallistTitle = args['1'] or ''  
-- Is this list on the same page as the page directly calling the template?
local onInitialPage = isOnInitialPage(args, sublist, pageTitle, initiallistTitle)  
-- Need just this parameter removed if blank, no others
if (hasValue(args.ShortSummary) == false) then
args.ShortSummary = nil
end  
local lineColor = getLineColor(args)
local rowColorEnabled = isRowColorEnabled(args)
local topColor = getTopColor(args, rowColorEnabled, onInitialPage)  
local root = mw.html.create -- Create the root mw.html object to return
row = root:tag('tr') -- Create the table row and store it globally
:addClass('vevent')
:css('text-align', '')
:css('background', topColor)  
local numberOfParameterGroups, multiTitleListEnabled = getnumberOfParameterGroups(args)  
if (multiTitleListEnabled and not args.Title_2) then
createMultiRowCells(args, numberOfParameterGroups, onInitialPage, title, topColor)
else
createSingleRowCells(args, numberOfParameterGroups, multiTitleListEnabled, onInitialPage, title)
end  
-- add these categories only in the mainspace and only if they are on the page where the template is used
if (onInitialPage and title.namespace == 0) then
addLineColorTrackingCategories(args)
addTopColorTrackingCategories(args)
end  
if (cellValueTBA == true and title.namespace == 0) then
addTrackingCategory(trackingCategoryList["tba_values"])
end  
-- Do not show the summary if this is being transcluded on the initial list page
-- Do include it on all other lists
if (onInitialPage and args.ShortSummary) then
local bottomWrapper = createShortSummaryRow(args, lineColor)
return tostring(root) .. tostring(bottomWrapper) .. trackingCategories
else
return tostring(root) .. trackingCategories
end
end  
-- Local function which handles both module entry points.
local function main(, sublist)
local getArgs = require('Module:Arguments').getArgs
local args  
-- Most parameters should still display when blank, so don't remove blanks
if (sublist) then
args = getArgs(, {removeBlanks = false, wrappers = 'Template:Episode list/sublist'})
else
args = getArgs(, {removeBlanks = false, wrappers = 'Template:Episode list'})
end  
-- args['1'] = mw.getCurrentFrame:getParent:getTitle
return _main(args, sublist, )
end  
--1= — required; The title of the article where the Episode Table is located at.
-- |EpisodeNumber= — suggested; The overall episode number in the series.
-- |EpisodeNumber2= — suggested; The episode number in the season.
-- |Title= — suggested; The English title of the episode.
-- |RTitle= — optional; Unformatted parameter that can be used to add a reference after "Title",
or can be used as a "raw title" to replace "Title" completely.
-- |AltTitle= — optional; An alternative title, such as the title of a foreign show's episode in its native language,
or a title that was originally changed.
-- |TranslitTitle= — optional; The title of the episode transliteration (Romanization) to Latin characters.
-- |RAltTitle= — optional; Unformatted parameter that can be used to add a reference after "AltTitle",
or can be used as a "raw title" to replace "AltTitle" completely.
-- |NativeTitle= — optional; The title of the episode in the native language.
-- |NativeTitleLangCode — optional; The language code of the native title language.
-- |Aux1= — optional; General purpose parameter. The meaning is specified by the column header.
This parameter is also used for Serial episode titles, such as those used in Doctor Who.
-- |DirectedBy= — optional; Name of the episode's director. May contain links.
-- |WrittenBy= — optional; Primary writer(s) of the episode. May include links.
-- |Aux2= — optional; General purpose parameter. The meaning is specified by the column header.
-- |Aux3= — optional; General purpose parameter. The meaning is specified by the column header.
-- |OriginalAirDate= — optional; This is the date the episode first aired on TV, or is scheduled to air.
-- |AltDate= — optional; The next notable air date, such as the first air date of an anime in English.
-- |Guests= — optional; List of Guests for talk shows. Cannot be used simultaneously with Aux1.
-- |MusicalGuests= — optional; List of MusicalGuests for talk shows. Cannot be used simultaneously with Aux2.
-- |ProdCode= — optional; The production code in the series. When defined, this parameter also creates a link anchor,
prefixed by "pc"; for example, List of episodes#pc01.
-- |Viewers= — optional; Number of viewers who watched the episode. Should include a reference.
-- |Aux4= — optional; General purpose parameter. The meaning is specified by the column header.
-- |ShortSummary= — optional; A short 100–200 word plot summary of the episode.
-- |LineColor= — optional; Colors the separator line between episode entries. If not defined the color defaults to "#CCCCFF"
and the article is placed in Category:Episode list using the default LineColor.
Use of "#", or anything but a valid hex code will result in an invalid syntax.
-- |TopColor= — discouraged; Colors the main row of information (that is, not the ShortSummary row).
Articles using this parameter are placed in Category:Episode lists with row deviations.
-- |RowColor= — optional; Switch parameter that must only be defined when the EpisodeNumber= entry is not a regular number
(e.g. "12–13" for two episodes described in one table entry).
If the first episode number is even, define pass "on". If the first episode number is odd, pass "off".
---
function p.sublist
return main(, true)
end  
---
Public function which is used to create an Episode row
for an Episode Table used for lists of episodes where all tables are on the same page.  
For tables which are on different pages see p.sublist.  
For complete parameter documentation, see the documentation at p.sublist.
---
function p.list
return main(, false)
end  
return p