匿名
未登录
中文(中国大陆)
登录
「荏苒之境」
搜索
查看“︁模块:InfoBox”︁的源代码
来自「荏苒之境」
命名空间
模块
讨论
更多
更多
页面操作
阅读
查看源代码
历史
清除缓存
←
模块:InfoBox
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local html = mw.html local csv = require("Module:Csv") local infobox = {} local function append_full_row(table_elem) return table_elem:tag("tr"):tag("th") :attr("colspan", "2") end local function append_header(frame, parent, text) local title = append_full_row(parent):wikitext(text) local args = frame.args local title_color = args.title_color local title_background = args.title_background if title_color then title:css("color", title_color) elseif title_background then title:css("background", title_background) end return title end local row_appenders = { title = function(...) append_header(...):addClass("infobox-title") end, section = function(...) append_header(...):addClass("infobox-header") end, image = function(frame, parent, file) append_full_row(parent) :addClass("infobox-image") :wikitext("[[File:{{{"..file.."}}}|300px]]") end, caption = function(frame, parent, text) append_full_row(parent) :addClass("infobox-caption") :wikitext(text) end, text = function(frame, parent, header, data) parent:tag("tr") :tag("th"):wikitext(header):done() :tag("td"):wikitext(data):done() end } local function append_row(frame, parent, row_type, ...) local appender = row_appenders[row_type] if appender == nil then return end return appender(frame, parent, ...) end infobox.show = function(frame) local args = frame.args local view = html.create("div"):addClass("infobox") local table_elem = view:tag("table") for i = 1, #args do append_row(frame, table_elem, unpack(csv.parse_row(args[i]))) end return view end return infobox
该页面使用的模板:
模块:InfoBox/doc
(
查看源代码
)
返回
模块:InfoBox
。
导航
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
wiki工具
wiki工具
Cargo数据
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志