Module:TabSwitch

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 ) if tonumber( arg ) then if episodes[arg] then return episodes[arg] 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

-- For use with #invoke

function p.main( frame ) return p._main( frame.args[1] ) end

return p