941
个编辑
Economy666(讨论 | 贡献) 小无编辑摘要 |
Economy666(讨论 | 贡献) 无编辑摘要 |
||
第68行: | 第68行: | ||
return al | return al | ||
end | end | ||
function p.packLink(packName, short) | |||
-- 曲包名称转换成链接 | |||
-- short | |||
-- true 简短(x Collaboration y) | |||
-- false 完整(x Collaboration - Collaboration y) | |||
local cc = 'Collaboration %- Collaboration' | |||
local ccl = 'Collaboration#Collaboration' | |||
local packLink = string.gsub(packName, cc, ccl) | |||
local packDisplay | |||
if short then | |||
local ccd = 'Collaboration' | |||
packDisplay = string.gsub(packName, cc, ccd) | |||
else | |||
packDisplay = packName | |||
end | |||
local pcak = link(packLink, packDisplay) | |||
end | |||
function p.packLinkId(packId, short) | |||
-- 曲包ID转换成链接 | |||
-- long_ver 同 p.packLink | |||
local trans = mw.loadJsonData 'Template:Transition.json' | |||
local packName = trans.packName(packId) | |||
local packLink = p.packLink(packName, short) | |||
end | |||
function p.artistLinkFrame(frame) | |||
if frame then | |||
if frame.args['name'] then | |||
local name = frame.args['name'] | |||
return p.packLink(name) | |||
elseif frame.args['id'] then | |||
local id = frame.args['id'] | |||
return p.packLinkId(id) | |||
end | |||
else | |||
return '' | |||
end | |||
end | |||
return p | return p |
个编辑