Content added Content deleted
mNo edit summary |
m (allow no link) |
||
Line 1: | Line 1: | ||
local getArgs = require('Module:Arguments').getArgs |
local getArgs = require('Module:Arguments').getArgs |
||
local utils = require('Module:Utilities') |
local utils = require('Module:Utilities') |
||
local yesno = require('Module:Yesno') |
|||
local p = {} |
local p = {} |
||
Line 30: | Line 31: | ||
root:tag('td'):wikitext(args['version']) |
root:tag('td'):wikitext(args['version']) |
||
if yesno(args['no link'], nil) then |
|||
⚫ | |||
root:tag('td'):wikitext(args['singer']) |
|||
else |
|||
⚫ | |||
end |
|||
root:tag('td'):wikitext(formatFile(args['audio'])) |
root:tag('td'):wikitext(formatFile(args['audio'])) |
||
Revision as of 04:08, 8 August 2021
Documentation for this module may be created at Module:Song versions line/doc
local getArgs = require('Module:Arguments').getArgs
local utils = require('Module:Utilities')
local yesno = require('Module:Yesno')
local p = {}
local function formatSingers(arg)
if arg and arg ~= '' then
local splits = utils.split(arg, ",")
for i=1,#splits do
splits[i] = '[[' .. splits[i] .. ']]'
end
return table.concat(splits, ", ")
end
return nil
end
local function formatFile(arg)
if arg and arg ~= '' then
return '[[' .. arg .. ']]'
end
return nil
end
function p.main(frame)
local args = getArgs(frame)
local root = mw.html.create('tr')
root:tag('td'):wikitext(args['version'])
if yesno(args['no link'], nil) then
root:tag('td'):wikitext(args['singer'])
else
root:tag('td'):wikitext(formatSingers(args['singers']))
end
root:tag('td'):wikitext(formatFile(args['audio']))
return tostring(root)
end
return p