Module:Sandbox/Ithea
跳到导航
跳到搜索
local getArgs = require('Module:Arguments').getArgs
local p = {}
function p.main(frame)
local args = getArgs(frame)
local lang = args["lang"] or "ja"
local result = {}
local indices = {}
for k, _ in pairs(args) do
local idx = tostring(k):match("^lb%-text(%d+)$")
if idx then
table.insert(indices, tonumber(idx))
end
end
table.sort(indices)
-- 按序输出
for _, i in ipairs(indices) do
local lb = args["lb-text" .. i] or ""
local rb = args["rb-text" .. i] or ""
local lbcolor = args["lb-color" .. i] or args["lb-color"] or ""
local rbcolor = args["rb-color" .. i] or args["rb-color"] or ""
table.insert(result,
frame:expandTemplate{
title = "Lyrics/brick",
args = {
["lb"] = lb,
["rb"] = rb,
["lb-color"] = lbcolor,
["rb-color"] = rbcolor,
["lang"] = lang
}
}
)
end
return table.concat(result, "")
end
return p