-- Module:ArcName
-- The purpose of this module is to return title of an arc (chapter)
-- given just the arc number.
-- Usage: {{#invoke:ArcName|aData|{{{1}}}}}
--        where {{{1}}} is the arc number
local p = {}
local episodedat = mw.loadData( 'Module:EpisodeTitle/Episodedat' )
function p.aData( frame )
	local arcNumber   = frame.args[1]
	local optionalArg = frame.args[2]
	local outputTxt  = nil
	if (episodedat[arcNumber]) ~= nil then  -- Check if the key arcNumber exists.
	    if optionalArg ~= nil then -- Basically any 2nd arg suppresses link.
	        outputTxt = episodedat[arcNumber].name
            outputTxt = '[[' .. episodedat[arcNumber].name .. ']]'
        if (episodedat[arcNumber].altname) ~= nil then
            outputTxt = outputTxt .. '/' .. episodedat[arcNumber].altname
	return outputTxt
return p
--[[Category:Lua modules]]

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.