local p = {}
function p.main(frame)
local args = frame:getParent().args -- 获取模板参数
local id = 1
local rows = {}
-- 添加開頭
table.insert(rows, '<center><div class="acml-dataPanel" style="display:table-cell; max-width:100%%;">')
-- 添加标题行
table.insert(rows, '{| align=center width=450px style="border:0px; text-align:center; line-height:1.3em;" class="infotemplate"')
table.insert(rows, '|-')
table.insert(rows, '| style="background:#FF0000; color:#FFFFFF; font-size:85%; padding:2px; border:2px; border-style:solid; border-radius:10px;width:450px;" | \'\'\'学园都市-书库:资料\'\'\'')
table.insert(rows, '|-')
table.insert(rows, '| style="background:#FF0000; color:#FFFFFF; font-size:85%; padding:2px; border:2px; border-style:solid; border-radius:10px;width:450px;" | \'\'\'机密\'\'\'')
table.insert(rows, '|}')
-- 遍历所有编号参数(1, 2, 3...)
while args[id] ~= nil do
local val = args[id]
if val ~= '' then -- 忽略空值
table.insert(rows, val)
table.insert(rows, '{| align=center width=450px style="border:0px; text-align:center; line-height:1.3em;" class="infotemplate"')
table.insert(rows, '|-')
table.insert(rows, '| style="background:#000000; color:#000000; font-size:85%; padding:2px; border:2px; border-style:solid; border-radius:10px;width:450px;" | ')
table.insert(rows, '|}')
end
id = id + 1
end
-- 添加結尾
table.insert(rows, '</div></center>')
-- 返回结果(作为 wikitext 渲染)
return table.concat(rows, '\n')
end
return p