打开/关闭搜索
搜索
打开/关闭菜单
10
29
3
584
大天使虫洞百科
导航
首页
加入EVE Online
资助甲虫
最近更改
随机页面
特殊页面
上传文件
外部链接
zKillboard
大天使对外频道(QQ)
大天使边境要塞(Discord)
打开/关闭外观设置菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
创建账号
登录
查看“︁Module:Protection banner/documentation”︁的源代码
来自大天使虫洞百科
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论
更多操作
←
Module:Protection banner/documentation
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
-- This module generates documentation for [[Module:Protection banner]]. -------------------------------------------------------------------------------- -- Documentation class -------------------------------------------------------------------------------- local Documentation = {} Documentation.__index = Documentation function Documentation:new(mainCfg, docCfg) return setmetatable({ _mainCfg = mainCfg, _docCfg = docCfg }, self) end function Documentation:makeReasonTable() -- Get the data from the cfg.banners table. local rowData = {} for action, reasonTables in pairs(self._mainCfg.banners) do for reason, t in pairs(reasonTables) do rowData[#rowData + 1] = { reason = reason, action = action, description = t.description } end end -- Sort the table into alphabetical order, first by action and then by -- reason. table.sort(rowData, function (t1, t2) if t1.action == t2.action then return t1.reason < t2.reason else return t1.action < t2.action end end) -- Assemble a wikitable of the data. local ret = {} ret[#ret + 1] = '{| class="wikitable"' if #rowData < 1 then ret[#ret + 1] = '|-' ret[#ret + 1] = string.format( '| colspan="3" | %s', self._docCfg['documentation-blurb-noreasons'] ) else -- Header ret[#ret + 1] = '|-' ret[#ret + 1] = string.format( '! %s\n! %s\n! %s', self._docCfg['documentation-heading-reason'], self._docCfg['documentation-heading-action'], self._docCfg['documentation-heading-description'] ) -- Rows for _, t in ipairs(rowData) do ret[#ret + 1] = '|-' ret[#ret + 1] = string.format( '| %s\n| %s\n| %s', t.reason, t.action, t.description or '' ) end end ret[#ret + 1] = '|}' return table.concat(ret, '\n') end -------------------------------------------------------------------------------- -- Exports -------------------------------------------------------------------------------- local p = {} function p.reasonTable() local mainCfg = require('Module:Protection banner/config') local docCfg = require('Module:Protection banner/documentation/config') local documentationObj = Documentation:new(mainCfg, docCfg) return documentationObj:makeReasonTable() end return p
返回
Module:Protection banner/documentation
。
查看“︁Module:Protection banner/documentation”︁的源代码
来自大天使虫洞百科