Module:消歧义
跳转到导航
跳转到搜索
可在Module:消歧义/doc创建此模块的帮助文档
local p = {}
function p.generateList(frame)
-- 获取参数
local args = frame:getParent().args
local output = {}
-- 遍历alt和desc参数,生成条目链接
for i = 1, 20 do
local desc = args['desc' .. i]
local alt = args['alt' .. i]
if desc and alt then
table.insert(output, '* 关于' .. desc .. ',请见\'\'\'[[' .. alt .. ']]\'\'\'。')
end
end
return table.concat(output, "\n")
end
return p