|
local p = {}
function p.main3(frame)
local args = (require('Module:Arguments').getArgs(frame))
local currentTitle = mw.title.getCurrentTitle()
local items = {}
for k, v in mTableTools.sparseIpairs(args) do
local title = mw.title.new(v, 828)
table.insert(items, string.format('* [[%s|%s]]', tostring(title), v))
end
if #items == 0 then
local subpageBlacklist = {
doc = true,
sandbox = true,
sandbox2 = true,
testcases = true
}
local fallback = subpageBlacklist[currentTitle.subpageText] and currentTitle.baseText or currentTitle.text
local title = mw.title.new(fallback, 828)
table.insert(items, string.format('* [[%s|%s]]', tostring(title), fallback))
end
return table.concat(items, '\n') .. p.renderTrackingCategories(args, args, currentTitle)
end
function p.main(frame)
title = title.basePageTitle
end
local prefix
if title:inNamespaces(828, 829) then
boxArgs.textprefix = '此模块使用[[Wikipedia:Lua|Lua语言]]:\n' .. moduleList
elseif title.namespace == 10 then
prefix = '此模板'
else
prefix = '此页面'
boxArgs.text = '此模板使用[[Wikipedia:Lua|Lua语言]]:\n' .. moduleList ▼
end
▲ boxArgs.text = prefix .. ' 此模板使用基于以下[[ Wikipedia:Lua |Lua语言]] 模块编写:\n' .. moduleList
end
boxArgs.type = 'notice'
|