WikiBuilder
329
次編輯
(创建页面,内容为“local p = {} local getArgs = require('Module:Arguments').getArgs local Data = mw.loadData('Module:RotaenoStoryData/PNodeText') -- Start -- local function makeInvokeFunc(funcName) return function(frame) local args = getArgs(frame) return p[funcName](args) end end p.main = makeInvokeFunc('_main') function p._main(args)-- 生成HTML的主函数 部分代码来源:Module:Songtable local id = args['bg'] or args['background'] or a…”) |
無編輯摘要 |
||
第19行: | 第19行: | ||
--- 构建HTML --- | --- 构建HTML --- | ||
local box = mw.html.create("table"):addClass("rotable mw-collapsible mw-collapsed storyTable"); | local box = mw.html.create("table"):addClass("rotable mw-collapsible mw-collapsed storyTable"); | ||
box:tag('tr'):tag('th'):tag('h4'):attr('id',id):wikitext( | local title = '场景 | ' .. d[1]; | ||
local subTitle; | |||
if d[2] == '' then subTitle = ' ' | |||
else title = title .. '(' .. d[2] .. ')';subTitle = d[2]; | |||
end | |||
box:tag('tr'):tag('th'):tag('h4'):attr('id',id):wikitext(title); | |||
local node = box:tag('tr'):tag('td'):addClass('bgSim'); | local node = box:tag('tr'):tag('td'):addClass('bgSim'); | ||
node:tag('div'):addClass('subTitle'):wikitext( | node:tag('div'):addClass('subTitle'):wikitext(subTitle); | ||
node:tag('div'):addClass('Title'):wikitext(d[1]); | node:tag('div'):addClass('Title'):wikitext(d[1]); | ||
node:tag('div'):addClass('Context'):wikitext(d[3]); | node:tag('div'):addClass('Context'):wikitext(d[3]); | ||
第35行: | 第40行: | ||
return tostring(box) | return tostring(box) | ||
end | end | ||
return p | return p; |