local p = {}
local getArgs = require('Module:Arguments').getArgs
function p.main(frame)
local args = getArgs(frame)
local years = {}
-- 收集所有年份参数
for key, value in pairs(args) do
if tonumber(key) and value ~= '' then
table.insert(years, tonumber(key))
end
end
-- 按年份倒序排序
table.sort(years, function(a, b) return a > b end)
local output = {}
for _, year in ipairs(years) do
table.insert(output, ';' .. year .. '年')
table.insert(output, args[year])
end
return table.concat(output, '\n')
end
return p