-- This module implements local q = local Navbox = require('Module:Navbox')
-- helper functionslocal function concatstrings(s) local r = table.concat(s, ) if r:match('^%s*$') then r = nil end return rend
local function concatstyles(s) local r = table.concat(s, ';') while r:match(';%s*;') do r = mw.ustring.gsub(r, ';%s*;', ';') end if r:match('^%s*;%s*$') then r = nil end return rend
function q._navbox(pargs) -- table for args passed to navbox local targs =
-- process args local passthrough = for k,v in pairs(pargs) do if k and type(k)
nil and pargs['group' .. n]
nil and pargs['section' .. n]
nil then local titlestyle = concatstyles local liststyle = concatstyles local title = concatstrings local list = concatstrings local state = (pargs['abbr' .. n] and pargs['abbr' .. n]
nil then targs['border'] = pargs[1] end
return Navbox._navbox(targs)end
function q.navbox(frame) local pargs = require('Module:Arguments').getArgs(frame,)
-- Read the arguments in the order they'll be output in, to make references number in the right order. local _ _ = pargs.title _ = pargs.above for i = 1, 20 do _ = pargs["group" .. tostring(i)] _ = pargs["list" .. tostring(i)] end _ = pargs.below
return q._navbox(pargs)end
return q