Module:Navigation Bar

-- This module implements.

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

local p = {}

- -- Template: Page tabs -- -- Creates a page tabs bar. - function p.main(frame) return p._main(getArgs(frame)) end

- -- function: _main(args: | table) -- -- Creates page tabs bar. Implements. - function p._main(args) local root = mw.html.create root:wikitext(yesno(args.NOTOC) and '' or nil) local troot = root:tag('table'):css{ ['background']=args.Background or '#331e1e', ['text-align']='center', ['width']='100%', ['border']=0, ['border-spacing']=0, ['border-collapse']='collapse', ['vertical-align']='top', }	local trow = troot:tag('tr') args[1] = args[1] or '' for i, link in ipairs(args) do		local thisPage if tonumber(args.This) == i then thisPage = true end trow:wikitext(p.makeTab(link, thisPage)) end trow:tag('td') :css{ ['border-bottom']='2px solid #a3b1bf', ['width']='3000px', }		:wikitext(' ') return tostring(root) end

- -- function: makeTab(link: string, thisPage?: string) -- -- Creates a tab for a page tabs layout. Used by `_main`. - function p.makeTab(link, thisPage) local tcell = mw.html.create tcell:tag('td') :css{ ['padding']='0.5em', ['background-color']=thisPage and '#584b4b' or '#331e1e', ['font-size']=not thisPage and '95%' or nil, ['line-height']='0.95em', ['border']='solid 2px #a3b1bf', ['border-bottom']=thisPage and 0, ['font-weight']=thisPage and 'bold', ['white-space']='nowrap', ['width']='20px', }		:wikitext(link) :done :tag('td') :css{ ['border-bottom']='2px solid #a3b1bf', ['width']='3px', ['padding']=0, }		:wikitext(' ') :done return tostring(tcell) end

return p