Zeroclanzhang(讨论 | 贡献)2024年1月16日 (二) 18:16的版本 (创建页面,内容为“-- This implements Template:navboxes local p = {} local getArgs = require('Module:Arguments').getArgs local Navbox = require('Module:Navbox') local function isnotempty(s) return s and s:match( '^%s*(.-)%s*$' ) ~= '' end local function navboxes(args, list) local navbar = (args['state'] and args['state'] == 'off') and 'off' or 'plain' local title = args['title'] or 'Links to related articles' local titlestyle = 'background:' .. (args['bg'] or '#e8e8ff') ..…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
This Lua module is used on many pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them.
This module depends on the following other modules:
-- This implements Template:navboxeslocalp={}localgetArgs=require('Module:Arguments').getArgslocalNavbox=require('Module:Navbox')localfunctionisnotempty(s)returnsands:match('^%s*(.-)%s*$')~=''endlocalfunctionnavboxes(args,list)localnavbar=(args['state']andargs['state']=='off')and'off'or'plain'localtitle=args['title']or'Links to related articles'localtitlestyle='background:'..(args['bg']or'#e8e8ff')..';'..(isnotempty(args['fg'])and('color:'..args['fg']..';')or'')..(isnotempty(args['bordercolor'])and('border: 1px solid '..args['bordercolor']..';')or'')..(args['titlestyle']or'')returnNavbox._navbox({navbar=navbar,title=title,list1=list,state=args['state']or'collapsed',titlestyle=titlestyle,liststyle='font-size:114%',listpadding='0px',tracking='no'})endfunctionp.top(frame)localargs=getArgs(frame)localparts=mw.text.split(navboxes(args,'<ADD LIST HERE>'),'<ADD LIST HERE>')returnparts[1]endfunctionp.bottom(frame)localargs={}localparts=mw.text.split(navboxes(args,'<ADD LIST HERE>'),'<ADD LIST HERE>')returnparts[2]endfunctionp.navbox(frame)localargs=getArgs(frame)locallist=args['list1']orargs['list']or''localtrack_cats=''iflist==''thenifmw.title.getCurrentTitle().namespace==0thentrack_cats='[[Category:Navboxes template with no content]]'endendreturnnavboxes(args,list)..track_catsendreturnp