模块:Gltd-Archive.lua:修订间差异
来自「荏苒之境」
无编辑摘要 |
无编辑摘要 |
||
第6行: | 第6行: | ||
end) | end) | ||
end | end | ||
local template = | |||
[[<div style="border: 5px solid rgb(189, 189, 189); padding-bottom: 0.5em; background-color: rgb(80, 119, 86); color: white;"> | |||
<h4 style="text-align: center;">${id}</h4> | |||
<p>本档案已被「荏苒之境」理事会锁定,权限级:${permission}。</p> | |||
</div>]] | |||
archive.show = function(frame) | archive.show = function(frame) | ||
第11行: | 第17行: | ||
local permission = frame.args.permission | local permission = frame.args.permission | ||
local event_group = frame.args.event_group | local event_group = frame.args.event_group | ||
return interp(template, frame.args) | |||
return interp( | |||
end | end | ||
return archive | return archive |
2025年7月30日 (三) 12:07的版本
此模块的文档可以在模块:Gltd-Archive.lua/doc创建
local archive = {}
function interp(s, tab)
return s:gsub('($%b{})', function(w)
return tab[w:sub(3, -2)] or w
end)
end
local template =
[[<div style="border: 5px solid rgb(189, 189, 189); padding-bottom: 0.5em; background-color: rgb(80, 119, 86); color: white;">
<h4 style="text-align: center;">${id}</h4>
<p>本档案已被「荏苒之境」理事会锁定,权限级:${permission}。</p>
</div>]]
archive.show = function(frame)
local id = frame.args.id
local permission = frame.args.permission
local event_group = frame.args.event_group
return interp(template, frame.args)
end
return archive