VOOZH about

URL: https://minecraft.wiki/w/Module:Navbox

⇱ Module:Navbox – Minecraft Wiki


Module:Navbox

From Minecraft Wiki
Jump to navigation Jump to search
Documentation[view] [edit] [history] [purge]Jump to code ↴

This module implements {{navbox}}. It should generally be invoked directly on template pages, rather than using the navbox template.

Parent arguments are automatically merged with directly passed arguments (the latter overwriting the former) and all arguments are normalised to trim whitespace and set empty arguments to nil.

Dependencies

See also

[view] [edit] [history] [purge]The above documentation is transcluded from Module:Navbox/doc.
localp={}
functionp.box(f)
localargs=require('Module:ProcessArgs').merge(true)
localnavbox={}
ifargs.titlethen
localclass=args.classor'collapsible'
localbodyStyle=args.bodystyleor''
ifbodyStyle~=''then
bodyStyle='style="'..bodyStyle..'"'
end
table.insert(navbox,' {| class="navbox hlist '..class..'" '..bodyStyle)
localtitleStyle=args.titlestyleor''
iftitleStyle~=''then
titleStyle='style="'..titleStyle..'"'
end
localnavbar=args[1]or''
ifnavbar~=''then
localmini=''
ifnavbar:match('navbar%-mini')then
mini='1'
end
navbar='<div class="navbox-navbar">'..f:expandTemplate({
title='navbar',
args={
args.name,
mini=mini
}
})..'</div>'
end
table.insert(navbox,'! class="navbox-top" colspan="2" '..titleStyle..' | '..navbar..'<span class="navbox-title">'..args.title..'</span>')
else
table.insert(navbox,' {| class="navbox-child"')
end
localgroupNums={}
fork,vinpairs(args)do
iftype(k)=='string'then
localgroupNum=k:match('group(%d+)')
ifgroupNumandvthen
table.insert(groupNums,tonumber(groupNum))
end
end
end
table.sort(groupNums)
localgroupStyle=args.groupstyleor''
locallistStyle=args.liststyleor''
for_,vinipairs(groupNums)do
locallist=args['list'..v]
iflistthen
table.insert(navbox,'|-\n! class="navbox-group" style="'..groupStyle..'" | '..args['group'..v])
table.insert(navbox,'| class="navbox-list" style="'..listStyle..'" | '..list:gsub('^([*#:{])','\n%1'))
end
end
table.insert(navbox,'|}')
navbox=table.concat(navbox,'\n'):gsub(' style=""','')
returnnavbox
end
returnp
Retrieved from "https://minecraft.wiki/w/Module:Navbox?oldid=2354110"

Navigation menu