local getArgs = require('Module:Arguments').getArgs
local p = {}
local function makeJaRuby(frame, base, ruby)
if base == ruby then
return base
else
return frame:expandTemplate{ title = 'ruby', args = { base, ruby, '', 'ja' } }
end
end
function p.main(frame)
local args = getArgs(frame)
local out = {}
local artist = args['画师'] or ''
local artistJa = args['画师日服名'] or ''
table.insert(out, makeJaRuby(frame, artist, artistJa))
local i = 2
while args['画师' .. i] do
local artistMore = args['画师' .. i] or ''
local artistMoreJa = args['画师日服名' .. i] or ''
table.insert(out, '&' .. makeJaRuby(frame, artistMore, artistMoreJa))
i = i + 1
end
return table.concat(out)
end
return p