Module:Page tabs explained

-- This module implements .

local getArgs = require('Module:Arguments').getArgslocal yesno = require('Module:Yesno')

local p =

function p.main(frame) local args = getArgs(frame) return p._main(args)end

function p._main(args) local makeTab = p.makeTab local root = mw.html.create root:wikitext(yesno(args.NOTOC) and '' or nil) local row = root:tag('div') :css('background', args.Background or '#f8fcff') :css('color', 'black') :cssText(args.style or nil) :addClass('template-page-tabs') :addClass(args.class or nil) if not args[1] then args[1] = '' end for i, link in ipairs(args) do makeTab(row, link, args, i, args["class" .. i] or nil, args["style" .. i] or nil) end return tostring(root)end

function p.makeTab(root, link, args, i, class, css) local thisPage = (args.This

'auto' and link:find('', 1, true)) or tonumber(args.This)