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

Module:Infobox song: Difference between revisions

From Sekaipedia
Content added Content deleted
m (Undo revision 22224 by ChaoticShadow (talk))
Tag: Undo
m (Reverted edits by Rixxy (talk) to last revision by ChaoticShadow)
Tag: Rollback
 
(47 intermediate revisions by 3 users not shown)
Line 1: Line 1:
--------------------------
--------------------------
-- Module for [[Template:Infobox Song]]
-- Module for [[Template:Infobox song]]
------------------------
------------------------
local getArgs = require('Module:Arguments').getArgs
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local InfoboxBuilder = require('Module:InfoboxBuilder')
local builder = require('Module:InfoboxBuilder')
local DisplayFns = require('Module:DisplayFunctions')
local constants = require('Module:Constants')
local ProcessingFns = require('Module:ProcessingFunctions')
local utils = require('Module:Utilities')
local constants = require('Module:Constants')
local VariablesLua = mw.ext.VariablesLua


local p = {}
local p = {}
local categories = ""


local function formatImage(image_name)
return string.format("[[File:%s|220px]]", image_name)
end

local function formatUnit(unit_name)
local unit = constants.get_unit(unit_name)
local unit_image = constants.get_unit_image(unit)
if unit and unit_image then
return string.format(
"[[File:%s|150px|link=%s]]",
unit_image,
unit
)
end
return nil
end

local function formatUnits(units)
if units then
local split_units = mw.text.split(units, ',')
for i,v in ipairs(split_units) do
split_units[i] = constants.get_unit(mw.text.trim(v))
end
return table.concat(split_units, "<br>")
end
return nil
end

local function formatNames(names)
if names then
local split_names = utils.split(names, ",")
for i,v in ipairs(split_names) do
split_names[i] = v:match( "^%s*(.-)%s*$" )
end
return table.concat(split_names, "<br>")
end
return nil
end


local function formatMv(mv)
local function getMvClass(mv)
local val = yesno(mv, nil)
-- probably should not use == with bool, but this is more explicit
-- probably should not use == with bool, but this is more explicit
if val == true then
if mv == true then
return ''
return 'true-cell'
elseif val == false then
elseif mv == false then
return ''
return 'false-cell'
end
end
Line 68: Line 23:
end
end


local function getMvCss(mv)
local function makeDifficultiesRow(difficulties)
local val = yesno(mv, nil)
-- probably should not use == with bool, but this is more explicit
if val == true then
return {
['background-color'] = 'lightgreen',
['font-weight'] = 'bold'
}
elseif val == false then
return {
['background-color'] = 'pink',
['font-weight'] = 'bold'
}
end
return nil
end

local function formatCommissioned(comm)
local val = yesno(comm, nil)
if val == true then
return 'Yes'
elseif val == false then
return 'No'
end
return nil
end

local function difficultiesRow()
local difficulties = { 'EASY', 'NORMAL', 'HARD', 'EXPERT', 'MASTER' }

local row = {}
local row = {}
Line 107: Line 31:
content = v,
content = v,
tag = 'th',
tag = 'th',
css = { ['border-bottom-color'] = constants.get_difficulty_color(v) }
css = {
['text-align'] = 'center',
['color'] = '#FFFFFF',
['border-radius'] = '5px',
['background-color'] = constants.get_difficulty_color(v)
}
}
}
)
)
Line 122: Line 41:


function p.main(frame)
function p.main(frame)
local args = getArgs(frame, { wrappers = { 'Template:Infobox Song' } })
local args = getArgs(frame)
local infobox = builder.new();
local infobox = InfoboxBuilder.new();
infobox:setName('Infobox Song')
infobox:setName('Infobox song')
:setWidth("330px")
:setParams{
:setParams{
{ name = 'song id' },
{ name = 'song id' },
{ name = 'song name', default = mw.title.getCurrentTitle().text },
{ name = 'song name', default = mw.title.getCurrentTitle().text },
{ name = 'image', func = formatImage, default = 'Dummyalbumart.png' },
{ name = 'jacket', default = 'Dummyalbumart.png' },
{ name = 'image alt', func = formatImage },
{ name = 'jacket alt' },
{ name = 'jacket alt 2' },
{ name = 'japanese' },
{ name = 'japanese' },
{ name = 'romaji' },
{ name = 'romaji' },
{ name = 'english' },
{ name = 'english' },
{ name = 'singer', func = formatNames },
{ name = 'singers', fn = ProcessingFns.stringToArray(',') },
{ name = 'producer', func = formatNames },
{ name = 'producers', fn = ProcessingFns.stringToArray(',') },
{ name = 'unit', func = formatUnits },
{ name = 'duration', fn = ProcessingFns.stringToNumber },
{ name = 'arranger', func = formatNames },
{ name = 'units', fn = ProcessingFns.stringToArray(';') },
{ name = 'composer', func = formatNames },
{ name = 'unlock' },
{ name = 'lyricist', func = formatNames },
{ name = 'arrangers', fn = ProcessingFns.stringToArray(',') },
{ name = 'commissioned', func = formatCommissioned },
{ name = 'composers', fn = ProcessingFns.stringToArray(',') },
{ name = 'lyricists', fn = ProcessingFns.stringToArray(',') },
{ name = 'type' },
{ name = 'bpm' },
{ name = 'bpm' },
{ name = 'duration' },
{ name = 'game duration', fn = ProcessingFns.stringToNumber },
{ name = 'date' },
{ name = 'date' },
{ name = '3d mv', func = formatMv },
{ name = '3d mv', fn = ProcessingFns.stringToBoolOrNil },
{ name = '2d mv', func = formatMv },
{ name = '2d mv', fn = ProcessingFns.stringToBoolOrNil },
{ name = 'original mv', func = formatMv },
{ name = 'original mv', fn = ProcessingFns.stringToBoolOrNil },
{ name = 'easy difficulty' },
{ name = 'easy difficulty' },
{ name = 'normal difficulty' },
{ name = 'normal difficulty' },
Line 153: Line 74:
{ name = 'expert difficulty' },
{ name = 'expert difficulty' },
{ name = 'master difficulty' },
{ name = 'master difficulty' },
{ name = 'append difficulty', default = 'N/A' },
{ name = 'easy notes' },
{ name = 'easy notes' },
{ name = 'normal notes' },
{ name = 'normal notes' },
Line 158: Line 80:
{ name = 'expert notes' },
{ name = 'expert notes' },
{ name = 'master notes' },
{ name = 'master notes' },
{ name = 'append notes', default = 'N/A' }
}
}
:setArgs(args)
:setArgs(args)
:processArgs()
:setCategoryMap({
['units'] = {
['VIRTUAL SINGER'] = 'VIRTUAL SINGER songs',
['Leo/need'] = 'Leo/need songs',
['MORE MORE JUMP!'] = 'MORE MORE JUMP! songs',
['Vivid BAD SQUAD'] = 'Vivid BAD SQUAD songs',
['Wonderlands×Showtime'] = 'Wonderlands×Showtime songs',
['25-ji, Nightcord de.'] = '25-ji, Nightcord de. songs',
['Other'] = 'Other songs'
},
['unlock'] = {
['Automatically unlocked'] = 'Songs unlocked automatically',
['Music Shop'] = 'Songs unlocked from the Music Shop',
['Present Box'] = 'Songs unlocked from the Present Box',
['Main Story'] = 'Songs unlocked from the Main Story'
},
['type'] = {
['Commissioned'] = 'Commissioned songs',
['Contest winner'] = 'Contest winning songs',
['Pre-existing'] = 'Pre-existing songs'
},
['3d mv'] = {
[true] = 'Songs with 3D MV'
},
['2d mv'] = {
[true] = 'Songs with 2D MV'
},
['original mv'] = {
[true] = 'Songs with Original MV'
},
})


infobox
infobox
:addHeader({ tag = 'argth', content = 'song name' })
:addHeader({ tag = 'argth', content = 'song name' })
:addImage(
:addImage({
{
tag = 'argtd',
content = 'jacket',
fn = DisplayFns.image('220px'),
tabName = 'Original'
},
{
{
{ tag = 'argtd', content = 'image', title = 'Original' },
tag = 'argtd',
{ tag = 'argtd', content = 'image alt', title = 'Alternate' }
content = 'jacket alt',
fn = DisplayFns.image('220px'),
}
tabName = 'Alternate'
)
},
{
tag = 'argtd',
content = 'jacket alt 2',
fn = DisplayFns.image('220px'),
tabName = 'Alternate #2'
},
})
:addRow(
:addRow(
{
{
{ tag = 'th', content = 'Japanese', colspan = 12 },
{ tag = 'th', content = 'Japanese' },
{ tag = 'argtd', content = 'japanese', colspan = 18 }
{ tag = 'argtd', content = 'japanese' }
},
},
{ hideIfEmpty = { 'japanese' } }
{ hideIfEmpty = { 'japanese' } }
Line 178: Line 147:
:addRow(
:addRow(
{
{
{ tag = 'th', content = 'Romaji', colspan = 12 },
{ tag = 'th', content = 'Romaji' },
{ tag = 'argtd', content = 'romaji', colspan = 18 }
{ tag = 'argtd', content = 'romaji' }
},
},
{ hideIfEmpty = { 'romaji' } }
{ hideIfEmpty = { 'romaji' } }
Line 185: Line 154:
:addRow(
:addRow(
{
{
{ tag = 'th', content = 'English', colspan = 12 },
{ tag = 'th', content = 'English' },
{ tag = 'argtd', content = 'english', colspan = 18 }
{ tag = 'argtd', content = 'english' }
},
},
{ hideIfEmpty = { 'english' } }
{ hideIfEmpty = { 'english' } }
Line 193: Line 162:
:addRow(
:addRow(
{
{
{
{ tag = 'th', content = 'Original Singer(s)', colspan = 12 },
{ tag = 'argtd', content = 'singer', colspan = 18 }
tag = 'argth',
content = 'singers',
fn = DisplayFns.pluralHeader({ 'Original singer', 'Original singers' })
},
{
tag = 'argtd',
content = 'singers',
fn = DisplayFns.list('unbulleted')
}
},
},
{ hideIfEmpty = { 'singer' } }
{ hideIfEmpty = { 'singers' } }
)
)
:addRow(
:addRow(
{
{
{
{ tag = 'th', content = 'Producer(s)', colspan = 12 },
{ tag = 'argtd', content = 'producer', colspan = 18 }
tag = 'argth',
content = 'producers',
fn = DisplayFns.pluralHeader({ 'Producer', 'Producers' })
},
{
tag = 'argtd',
content = 'producers',
fn = DisplayFns.list('unbulleted')
}
}
}
)
)
:addHeader({ tag = 'th', content = 'In-game Information' }, { subheader = true })
:addRow(
:addRow(
{
{
{
{ tag = 'th', content = 'Unit(s)', colspan = 12 },
{ tag = 'argtd', content = 'unit', colspan = 18 }
tag = 'th',
content = 'Duration'
},
{
tag = 'argtd',
content = 'duration',
fn = DisplayFns.minutesAndSeconds
}
},
},
{ hideIfEmpty = { 'unit' } }
{ hideIfEmpty = { 'duration' } }
)
)
:addHeader({ tag = 'th', content = 'In-game Information' }, { subheader = true })
:addRow(
:addRow(
{
{
{ tag = 'th', content = 'Arranger(s)', colspan = 12 },
{ tag = 'th', content = 'Song ID' },
{ tag = 'argtd', content = 'arranger', colspan = 18 }
{ tag = 'argtd', content = 'song id' }
}
)
:addRow(
{
{
tag = 'argth',
content = 'units',
fn = DisplayFns.pluralHeader({ 'Unit category', 'Unit categories' })
},
{
tag = 'argtd',
content = 'units',
fn = DisplayFns.list('unbulleted')
}
}
)
:addRow(
{
{ tag = 'th', content = 'How to unlock' },
{ tag = 'argtd', content = 'unlock' }
}
)
:addRow(
{
{
tag = 'argth',
content = 'arrangers',
fn = DisplayFns.pluralHeader({ 'Arranger', 'Arrangers' })
},
{
tag = 'argtd',
content = 'arrangers',
fn = DisplayFns.list('unbulleted')
}
},
},
{ hideIfEmpty = { 'arranger' } }
{ hideIfEmpty = { 'arrangers' } }
)
)
:addRow(
:addRow(
{
{
{
{ tag = 'th', content = 'Composer(s)', colspan = 12 },
{ tag = 'argtd', content = 'composer', colspan = 18 }
tag = 'argth',
content = 'composers',
fn = DisplayFns.pluralHeader({ 'Composer', 'Composers' })
},
{
tag = 'argtd',
content = 'composers',
fn = DisplayFns.list('unbulleted')
}
},
},
{ hideIfEmpty = { 'composer' } }
{ hideIfEmpty = { 'composers' } }
)
)
:addRow(
:addRow(
{
{
{
{ tag = 'th', content = 'Lyricist(s)', colspan = 12 },
{ tag = 'argtd', content = 'lyricist', colspan = 18 }
tag = 'argth',
content = 'lyricists',
fn = DisplayFns.pluralHeader({ 'Lyricist', 'Lyricists' })
},
{
tag = 'argtd',
content = 'lyricists',
fn = DisplayFns.list('unbulleted')
}
},
},
{ hideIfEmpty = { 'lyricist' } }
{ hideIfEmpty = { 'lyricists' } }
)
)
:addRow(
:addRow(
{
{
{ tag = 'th', content = 'Commissioned', colspan = 12 },
{ tag = 'th', content = 'Type' },
{ tag = 'argtd', content = 'commissioned', colspan = 18 }
{ tag = 'argtd', content = 'type' }
}
}
)
)
:addRow(
:addRow(
{
{
{ tag = 'th', content = 'BPM', colspan = 12 },
{ tag = 'th', content = 'BPM' },
{ tag = 'argtd', content = 'bpm', colspan = 18 }
{ tag = 'argtd', content = 'bpm' }
}
}
)
)
:addRow(
:addRow(
{
{
{
{ tag = 'th', content = 'Duration', colspan = 12 },
{ tag = 'argtd', content = 'duration', colspan = 18 }
tag = 'th',
content = 'Duration (game)'
},
{
tag = 'argtd',
content = 'game duration',
fn = DisplayFns.minutesAndSeconds
}
}
}
)
)
:addRow(
:addRow(
{
{
{ tag = 'th', content = 'Release Date', colspan = 12 },
{ tag = 'th', content = 'Release date' },
{ tag = 'argtd', content = 'date', colspan = 18 }
{ tag = 'argtd', content = 'date' }
}
}
)
)
Line 264: Line 313:
{ tag = 'th', content = 'Original' }
{ tag = 'th', content = 'Original' }
},
},
{ default_css = { ['text-align'] = 'center' } }
{ defaultCss = { ['text-align'] = 'center' } }
)
)
:addRow(
:addRow(
{
{
{
{ tag = 'argtd', content = '3d mv', param_css = { getMvCss } },
{ tag = 'argtd', content = '2d mv', param_css = { getMvCss } },
tag = 'argtd',
{ tag = 'argtd', content = 'original mv', param_css = { getMvCss } }
content = '3d mv',
fn = DisplayFns.checkAndX,
classFns = { getMvClass }
},
{
tag = 'argtd',
content = '2d mv',
fn = DisplayFns.checkAndX,
classFns = { getMvClass }
},
{
tag = 'argtd',
content = 'original mv',
fn = DisplayFns.checkAndX,
classFns = { getMvClass }
},
},
},
{ default_css = { ['text-align'] = 'center' } }
{ defaultCss = { ['text-align'] = 'center' } }
)
)
:addHeader({ tag = 'th', content = 'Difficulties' }, { subheader = true })
:addHeader({ tag = 'th', content = 'Difficulties' }, { subheader = true })
:addRow(difficultiesRow())
:addRow(
makeDifficultiesRow({ 'Easy', 'Normal', 'Hard' }),
{
defaultCss = {
['text-align'] = 'center',
['border-bottom-style'] = 'solid'
}
}
)
:addRow(
:addRow(
{
{
{ tag = 'argtd', content = 'easy difficulty' },
{ tag = 'argtd', content = 'easy difficulty' },
{ tag = 'argtd', content = 'normal difficulty' },
{ tag = 'argtd', content = 'normal difficulty' },
{ tag = 'argtd', content = 'hard difficulty' },
{ tag = 'argtd', content = 'hard difficulty' }
},
{ defaultCss = { ['text-align'] = 'center' } }
)
:addRow(
makeDifficultiesRow({ 'Expert', 'Master', 'Append' }),
{
defaultCss = {
['text-align'] = 'center',
['border-bottom-style'] = 'solid'
}
}
)
:addRow(
{
{ tag = 'argtd', content = 'expert difficulty' },
{ tag = 'argtd', content = 'expert difficulty' },
{ tag = 'argtd', content = 'master difficulty' }
{ tag = 'argtd', content = 'master difficulty' },
{ tag = 'argtd', content = 'append difficulty' }
},
},
{ default_css = { ['text-align'] = 'center' } }
{ defaultCss = { ['text-align'] = 'center' } }
)
)
:addHeader({ tag = 'th', content = 'Notes' }, { subheader = true })
:addHeader({ tag = 'th', content = 'Notes' }, { subheader = true })
:addRow(difficultiesRow())
:addRow(
makeDifficultiesRow({ 'Easy', 'Normal', 'Hard' }),
{
defaultCss = {
['text-align'] = 'center',
['border-bottom-style'] = 'solid'
}
}
)
:addRow(
:addRow(
{
{
{ tag = 'argtd', content = 'easy notes' },
{ tag = 'argtd', content = 'easy notes' },
{ tag = 'argtd', content = 'normal notes' },
{ tag = 'argtd', content = 'normal notes' },
{ tag = 'argtd', content = 'hard notes' },
{ tag = 'argtd', content = 'hard notes' }
},
{ defaultCss = { ['text-align'] = 'center' } }
)
:addRow(
makeDifficultiesRow({ 'Expert', 'Master', 'Append' }),
{
defaultCss = {
['text-align'] = 'center',
['border-bottom-style'] = 'solid'
}
}
)
:addRow(
{
{ tag = 'argtd', content = 'expert notes' },
{ tag = 'argtd', content = 'expert notes' },
{ tag = 'argtd', content = 'master notes' }
{ tag = 'argtd', content = 'master notes' },
{ tag = 'argtd', content = 'append notes' }
},
},
{ default_css = { ['text-align'] = 'center' } }
{ defaultCss = { ['text-align'] = 'center' } }
)
)
local categories = ""
if mw.title.getCurrentTitle().namespace == 0 then
if mw.title.getCurrentTitle().namespace == 0 then
categories = "[[Category:Songs]]" .. categories
categories = "[[Category:Songs]]" .. infobox:getCategories()
local procArgs = infobox:getArgs('processed')
local rawArgs = infobox:getArgs('raw')
if yesno(rawArgs['commissioned'], nil) then
categories = categories .. "[[Category:Commissioned Songs]]"
end
if yesno(rawArgs['3d mv'], nil) then
local rawArgs = infobox:getRawArgs()
VariablesLua.vardefine( 'song id', rawArgs['song id'] )
categories = categories .. "[[Category:Songs with 3D MV]]"
end
if yesno(rawArgs['2d mv'], nil) then
categories = categories .. "[[Category:Songs with 2D MV]]"
end
if yesno(rawArgs['original mv'], nil) then
categories = categories .. "[[Category:Songs with Original MV]]"
end
end
end



Latest revision as of 14:03, 11 December 2023

To generate {{Infobox song}}, invoke using the main function.


--------------------------
-- Module for [[Template:Infobox song]]
------------------------
local getArgs        = require('Module:Arguments').getArgs
local InfoboxBuilder = require('Module:InfoboxBuilder')
local DisplayFns     = require('Module:DisplayFunctions')
local ProcessingFns  = require('Module:ProcessingFunctions')
local constants      = require('Module:Constants')
local VariablesLua = mw.ext.VariablesLua

local p = {}


local function getMvClass(mv)
	-- probably should not use == with bool, but this is more explicit
	if mv == true then
		return 'true-cell'
	elseif mv == false then
		return 'false-cell'
	end
	
	return nil
end

local function makeDifficultiesRow(difficulties)
	local row = {}
	
	for _,v in ipairs(difficulties) do
		table.insert(row,
			{
				content = v,
				tag = 'th',
				css = {	['border-bottom-color'] = constants.get_difficulty_color(v)	}
			}
		)
	end
	
	return row
end


function p.main(frame)
	local args = getArgs(frame)
	local infobox = InfoboxBuilder.new();
	
	infobox:setName('Infobox song')
		:setParams{
			{ name = 'song id' },
			{ name = 'song name', default = mw.title.getCurrentTitle().text },
			{ name = 'jacket', default = 'Dummyalbumart.png' },
			{ name = 'jacket alt' },
			{ name = 'jacket alt 2' },
			{ name = 'japanese' },
			{ name = 'romaji' },
			{ name = 'english' },
			{ name = 'singers',   fn = ProcessingFns.stringToArray(',') },
			{ name = 'producers', fn = ProcessingFns.stringToArray(',') },
			{ name = 'duration', fn = ProcessingFns.stringToNumber },
			{ name = 'units', fn = ProcessingFns.stringToArray(';') },
			{ name = 'unlock' },
			{ name = 'arrangers', fn = ProcessingFns.stringToArray(',') },
			{ name = 'composers', fn = ProcessingFns.stringToArray(',') },
			{ name = 'lyricists', fn = ProcessingFns.stringToArray(',') },
			{ name = 'type' },
			{ name = 'bpm' },
			{ name = 'game duration', fn = ProcessingFns.stringToNumber },
			{ name = 'date' },
			{ name = '3d mv',       fn = ProcessingFns.stringToBoolOrNil },
			{ name = '2d mv',       fn = ProcessingFns.stringToBoolOrNil },
			{ name = 'original mv', fn = ProcessingFns.stringToBoolOrNil },
			{ name = 'easy difficulty' },
			{ name = 'normal difficulty' },
			{ name = 'hard difficulty' },
			{ name = 'expert difficulty' },
			{ name = 'master difficulty' },
			{ name = 'append difficulty', default = 'N/A' },
			{ name = 'easy notes' },
			{ name = 'normal notes' },
			{ name = 'hard notes' },
			{ name = 'expert notes' },
			{ name = 'master notes' },
			{ name = 'append notes', default = 'N/A' }
		}
		:setArgs(args)
		:processArgs()
		:setCategoryMap({
			['units'] = {
				['VIRTUAL SINGER']       = 'VIRTUAL SINGER songs',
				['Leo/need']             = 'Leo/need songs',
				['MORE MORE JUMP!']      = 'MORE MORE JUMP! songs',
				['Vivid BAD SQUAD']      = 'Vivid BAD SQUAD songs',
				['Wonderlands×Showtime'] = 'Wonderlands×Showtime songs',
				['25-ji, Nightcord de.'] = '25-ji, Nightcord de. songs',
				['Other']                = 'Other songs'
			},
			['unlock'] = {
				['Automatically unlocked'] = 'Songs unlocked automatically',
				['Music Shop'] = 'Songs unlocked from the Music Shop',
				['Present Box'] = 'Songs unlocked from the Present Box',
				['Main Story'] = 'Songs unlocked from the Main Story'
			},
			['type'] = {
				['Commissioned'] = 'Commissioned songs',
				['Contest winner'] = 'Contest winning songs',
				['Pre-existing'] = 'Pre-existing songs'
			},
			['3d mv'] = {
				[true] = 'Songs with 3D MV'
			},
			['2d mv'] = {
				[true] = 'Songs with 2D MV'
			},
			['original mv'] = {
				[true] = 'Songs with Original MV'
			},
		})

	infobox
		:addHeader({ tag = 'argth', content = 'song name' })
		:addImage({
			{ 
				tag = 'argtd',
				content = 'jacket',
				fn = DisplayFns.image('220px'),
				tabName = 'Original'
			},
			{
				tag = 'argtd',
				content = 'jacket alt',
				fn = DisplayFns.image('220px'),
				tabName = 'Alternate'
			},
			{
				tag = 'argtd',
				content = 'jacket alt 2',
				fn = DisplayFns.image('220px'),
				tabName = 'Alternate #2'
			},
		})
		:addRow(
			{
				{ tag = 'th', content = 'Japanese' },
				{ tag = 'argtd', content = 'japanese' }
			},
			{ hideIfEmpty = { 'japanese' } }
		)
		:addRow(
			{
				{ tag = 'th', content = 'Romaji' },
				{ tag = 'argtd', content = 'romaji' }
			},
			{ hideIfEmpty = { 'romaji' } }
		)
		:addRow(
			{
				{ tag = 'th', content = 'English' },
				{ tag = 'argtd', content = 'english' }
			},
			{ hideIfEmpty = { 'english' } }
		)
		:addHeader({ tag = 'th', content = 'Song Information' }, { subheader = true })
		:addRow(
			{
				{ 
					tag = 'argth', 
					content = 'singers', 
					fn = DisplayFns.pluralHeader({ 'Original singer', 'Original singers' }) 
				},
				{ 
					tag = 'argtd', 
					content = 'singers', 
					fn = DisplayFns.list('unbulleted') 
				}
			},
			{ hideIfEmpty = { 'singers' } }
		)
		:addRow(
			{
				{ 
					tag = 'argth', 
					content = 'producers', 
					fn = DisplayFns.pluralHeader({ 'Producer', 'Producers' })
				},
				{ 
					tag = 'argtd', 
					content = 'producers',
					fn = DisplayFns.list('unbulleted')
				}
			}
		)
		:addRow(
			{
				{
					tag = 'th',
					content = 'Duration'
				},
				{
					tag = 'argtd',
					content = 'duration',
					fn = DisplayFns.minutesAndSeconds
				}
			},
			{ hideIfEmpty = { 'duration' } }
		)
		:addHeader({ tag = 'th', content = 'In-game Information' }, { subheader = true })
		:addRow(
			{
				{ tag = 'th', content = 'Song ID' },
				{ tag = 'argtd', content = 'song id' }
			}
		)
		:addRow(
			{
				{ 
					tag = 'argth',
					content = 'units', 
					fn = DisplayFns.pluralHeader({ 'Unit category', 'Unit categories' }) 
				},
				{ 
					tag = 'argtd', 
					content = 'units', 
					fn = DisplayFns.list('unbulleted')
				}
			}
		)
		:addRow(
			{
				{ tag = 'th', content = 'How to unlock' },
				{ tag = 'argtd', content = 'unlock' }
			}
		)
		:addRow(
			{
				{ 
					tag = 'argth', 
					content = 'arrangers',
					fn = DisplayFns.pluralHeader({ 'Arranger', 'Arrangers' })
				},
				{ 
					tag = 'argtd',
					content = 'arrangers',
					fn = DisplayFns.list('unbulleted')
				}
			},
			{ hideIfEmpty = { 'arrangers' } }
		)
		:addRow(
			{
				{ 
					tag = 'argth',
					content = 'composers',
					fn = DisplayFns.pluralHeader({ 'Composer', 'Composers' })
				},
				{ 
					tag = 'argtd', 
					content = 'composers', 
					fn = DisplayFns.list('unbulleted') 
				}
			},
			{ hideIfEmpty = { 'composers' } }
		)
		:addRow(
			{
				{ 
					tag = 'argth',
					content = 'lyricists',
					fn = DisplayFns.pluralHeader({ 'Lyricist', 'Lyricists' })
				},
				{ 
					tag = 'argtd', 
					content = 'lyricists',
					fn = DisplayFns.list('unbulleted') 
				}
			},
			{ hideIfEmpty = { 'lyricists' } }
		)
		:addRow(
			{
				{ tag = 'th', content = 'Type' },
				{ tag = 'argtd', content = 'type' }
			}
		)
		:addRow(
			{
				{ tag = 'th', content = 'BPM' },
				{ tag = 'argtd', content = 'bpm' }
			}
		)
		:addRow(
			{
				{ 
					tag = 'th', 
					content = 'Duration (game)'
				},
				{
					tag = 'argtd',
					content = 'game duration',
					fn = DisplayFns.minutesAndSeconds
				}
			}
		)
		:addRow(
			{
				{ tag = 'th', content = 'Release date' },
				{ tag = 'argtd', content = 'date' }
			}
		)
		:addHeader({ tag = 'th', content = 'Music Video' }, { subheader = true })
		:addRow(
			{
				{ tag = 'th', content = '3D' },
				{ tag = 'th', content = '2D' },
				{ tag = 'th', content = 'Original' }
			},
			{ defaultCss = { ['text-align'] = 'center'	} }
		)
		:addRow(
			{
				{
					tag = 'argtd', 
					content = '3d mv',
					fn = DisplayFns.checkAndX, 
					classFns = { getMvClass }
				},
				{
					tag = 'argtd',
					content = '2d mv', 
					fn = DisplayFns.checkAndX,
					classFns = { getMvClass }
				},
				{
					tag = 'argtd', 
					content = 'original mv', 
					fn = DisplayFns.checkAndX, 
					classFns = { getMvClass }
				},
			},
			{ defaultCss = { ['text-align'] = 'center' } }
		)
		:addHeader({ tag = 'th', content = 'Difficulties' }, { subheader = true })
		:addRow(
			makeDifficultiesRow({ 'Easy', 'Normal', 'Hard' }),
			{
				defaultCss = { 
					['text-align'] = 'center',
					['border-bottom-style'] = 'solid' 
				}
			}
		)
		:addRow(
			{
				{ tag = 'argtd', content = 'easy difficulty' },
				{ tag = 'argtd', content = 'normal difficulty' },
				{ tag = 'argtd', content = 'hard difficulty' }
			},
			{ defaultCss = { ['text-align'] = 'center' } }
		)
		:addRow(
			makeDifficultiesRow({ 'Expert', 'Master', 'Append' }),
			{
				defaultCss = { 
					['text-align'] = 'center',
					['border-bottom-style'] = 'solid' 
				}
			}
		)
		:addRow(
			{
				{ tag = 'argtd', content = 'expert difficulty' },
				{ tag = 'argtd', content = 'master difficulty' },
				{ tag = 'argtd', content = 'append difficulty' }
			},
			{ defaultCss = { ['text-align'] = 'center' } }
		)
		:addHeader({ tag = 'th', content = 'Notes' }, { subheader = true })
		:addRow(
			makeDifficultiesRow({ 'Easy', 'Normal', 'Hard' }),
			{
				defaultCss = { 
					['text-align'] = 'center',
					['border-bottom-style'] = 'solid' 
				}
			}
		)
		:addRow(
			{
				{ tag = 'argtd', content = 'easy notes' },
				{ tag = 'argtd', content = 'normal notes' },
				{ tag = 'argtd', content = 'hard notes' }
			},
			{ defaultCss = { ['text-align'] = 'center' } }
		)
		:addRow(
			makeDifficultiesRow({ 'Expert', 'Master', 'Append' }),
			{
				defaultCss = { 
					['text-align'] = 'center',
					['border-bottom-style'] = 'solid' 
				}
			}
		)
		:addRow(
			{
				{ tag = 'argtd', content = 'expert notes' },
				{ tag = 'argtd', content = 'master notes' },
				{ tag = 'argtd', content = 'append notes' }
			},
			{ defaultCss = { ['text-align'] = 'center' } }
		)
	
	local categories = ""
	if mw.title.getCurrentTitle().namespace == 0 then
		categories = "[[Category:Songs]]" .. infobox:getCategories()
		
		local rawArgs = infobox:getRawArgs()
		VariablesLua.vardefine( 'song id', rawArgs['song id'] )
	end

	return infobox:tostring() .. categories
end

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