Module:Navigation

-- local p = {}

local title = mw.title.getCurrentTitle

function section(html, text, link) local tag = html:tag('div') :addClass('article-tabs__tab') :wikitext( .. text .. ) if title.text == link then tag:addClass('article-tabs__selected') end tag:done end

function p.main(frame) local args = frame:getParent.args local html = mw.html.create('div') :addClass('article-tabs') local text = title.baseText local nogallery = false local nosprites = false for k, v in ipairs(args) do       if v == 'nogallery' then nogallery = true elseif v == 'nosprites' then nosprites = true end end section(html, text, text) if args[1] == 'game' then section(html, 'Gallery', text .. '/Image Gallery') section(html, 'Trophies', text .. '/Trophies') else if not nogallery then section(html, 'Gallery', text .. '/Image Gallery') end if not nosprites then section(html, 'Sprites', text .. '/Sprite Gallery') end end return tostring(html:done) end

return p