Module:Lua banner:修订间差异

删除的内容 添加的内容
回到 main/main2 方案,renderBox 文字改为「此模板/页面基于以下Lua模块编写」
renderBox 改用 、 内联拼接,去掉 mList.makeList 列表换行
第1行:
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
第45行 ⟶ 第44行:
local moduleLinks = {}
for i, module in ipairs(modules) do
moduleLinks[i]local link = '[[:Module:' .. mw.title.new(module).text .. ']]'
local maybeSandbox = mw.title.new(module .. '/sandbox')
if maybeSandbox and maybeSandbox.exists then
moduleLinks[i]link = moduleLinks[i]link .. string.format('([[:%s|沙盒]])', maybeSandbox.fullText)
end
moduleLinks[i] = link
end
local moduleList = mList.makeList('bulleted', moduleLinks)
local title = mw.title.getCurrentTitle()
if title.subpageText == 'doc' then
第64行 ⟶ 第63行:
prefix = '此页面'
end
boxArgs.text = prefix .. '基于以下[[Lua]]模块编写:\n' .. moduleListtable.concat(moduleLinks, '、')
end
boxArgs.type = 'notice'