956
次編輯
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 |
次編輯