Documentation for this module may be created at Module:TabSwitch/doc
local p = {}
-- Load the episodes
local episodes = mw.loadData( "Module:TabSwitch/data" )
-- Substitutes a number to the corresponding episode, or vice versa
function p.main( arg )
local numarg = tonumber( arg )
if numarg then
if episodes[numarg] then
return episodes[numarg]
else
return "N/A"
end
else
for i, v in ipairs( episodes ) do
if v == arg then
return i
end
end
return "N/A"
end
end
return p