Fandom

Kubera Wiki

Module:ArcName

667pages on
this wiki
Add New Page
Talk0
--
-- 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
        else
            outputTxt = '[[' .. episodedat[arcNumber].name .. ']]'
        end
        if (episodedat[arcNumber].altname) ~= nil then
            outputTxt = outputTxt .. '/' .. episodedat[arcNumber].altname
        end
	end
	return outputTxt
end
 
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.