切换搜索
搜索
切换菜单
notifications
切换个人菜单
查看“模块:DemoTemplate”的源代码
来自决策链云智库
更多操作
←
模块:DemoTemplate
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
require('strict') local newBuffer = require('Module:OutputBuffer') local mt = {} function mt.__index(t, title) return function(frame) local getBuffer, print, printf = newBuffer() printf('{{%s', title) local ipairsArgs = {} for k,v in ipairs(frame.args) do if string.find(v, '=', 1, true) then break end ipairsArgs[k] = true printf('|%s', v) end for k,v in pairs(frame.args) do if not ipairsArgs[k] then printf('|%s=%s', string.gsub(k, '=', '{{=}}'), v) end end print('}}') local buffer = getBuffer() -- rather than calling expandTemplate with the title and args we have, call preprocess, so that our code example will always match our output, even in the cases of pipes or other things we should have escaped but didn't return string.format('<code>%s</code> → %s', mw.text.nowiki(buffer), frame:preprocess(buffer)) end end return setmetatable({}, mt)
本页使用的模板:
模板:Module other
(
查看源代码
)
模板:Module rating
(
查看源代码
)
模板:Ombox
(
查看源代码
)
模板:Sandbox other
(
查看源代码
)
模块:Arguments
(
查看源代码
)
模块:DemoTemplate
(
查看源代码
)
模块:DemoTemplate/doc
(
查看源代码
)
模块:Message box
(
查看源代码
)
模块:Message box/configuration
(
查看源代码
)
模块:Message box/ombox.css
(
查看源代码
)
模块:OutputBuffer
(
查看源代码
)
模块:String
(
查看源代码
)
模块:Yesno
(
查看源代码
)
返回
模块:DemoTemplate
。