Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Song versions line

From Sekaipedia
Revision as of 20:58, 7 August 2021 by ChaoticShadow (talk | contribs)

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 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'])
	root:tag('td'):wikitext(formatSingers(args['singers']))
	root:tag('td'):wikitext(formatFile(args['audio']))
	
	return tostring(root)
end

return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies.