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.prefixedText:gsub('^[^:]+:', '') 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 not nogallery then section(html, 'Gallery', 'Gallery:' .. text) end if not nosprites then section(html, 'Sprites', 'Sprites:' .. text) end return tostring(html:done) end

return p