查看“Module:Tabs”的源代码
←
Module:Tabs
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
local p = {} function p.main(frame) local args = frame:getParent().args local indices = {} -- 收集有效标签索引 for k, _ in pairs(args) do local num = k:match('^bt(%d+)$') or k:match('^tab(%d+)$') if num then indices[tonumber(num)] = true end end -- 处理标签排序 local sorted = {} for k in pairs(indices) do table.insert(sorted, k) end table.sort(sorted) -- 确定默认标签位置(基于参数顺序) local default_pos = math.min(tonumber(args.DefaultTab) or 1, #sorted) -- 构建标签内容 local tabberContent = {} for pos, idx in ipairs(sorted) do local title = args['bt'..idx] or '' local content = args['tab'..idx] or '' table.insert(tabberContent, string.format('|-| %s=%s', title, content)) end return mw.getCurrentFrame():preprocess( '<tabber>\n'..table.concat(tabberContent, '\n')..'\n</tabber>' ) end -- 添加数学函数兼容 math.min = math.min or function(a, b) return a < b and a or b end return p
该页面使用的模板:
Module:Tabs/doc
(
查看源代码
)
返回
Module:Tabs
。
导航菜单
个人工具
中文
创建账号
登录
命名空间
模块
讨论
English
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
最新文件
随机页面
官方Discord
浏览NeuroWiki
人物列表
直播记录
梗列表
事件列表
物品列表
场景列表
辟谣专区
帮助
帮助
沙盒
NeuroWiki政策文件
编辑规范
怎么正确编辑&更新?
工具
链入页面
相关更改
上传文件
特殊页面
页面信息