Module:Infobox chord: Difference between revisions
Remove the (now unused) Name parameter. |
Move color names to middle of table; make code more consistent with other multi-valued entries |
||
| Line 14: | Line 14: | ||
local cats = "" | local cats = "" | ||
local | local color_names = {} | ||
if utils.value_provided(frame.args["ColorName"]) then | |||
color_name = frame.args["ColorName"] | |||
-- search for ", " not "," because many chord names contain commas, e.g. Cz,y6 | -- search for ", " not "," because many chord names contain commas, e.g. Cz,y6 | ||
for name in (color_name .. ", "):gmatch("(.-), ") do | |||
table.insert(color_names, name) | |||
end | end | ||
else | else | ||
cats = cats .. "[[Category:Todo:add color name]]" | cats = cats .. "[[Category:Todo:add color name]]" | ||
| Line 201: | Line 189: | ||
table.insert(infobox_data, {"Step intervals", table.concat(step_interval_links, ", ")}) | table.insert(infobox_data, {"Step intervals", table.concat(step_interval_links, ", ")}) | ||
table.insert(infobox_data, {"Step cents", table.concat(step_cents, ", ")}) | table.insert(infobox_data, {"Step cents", table.concat(step_cents, ", ")}) | ||
-- TODO: category goes here. | |||
if table.getn(color_names) > 0 then | |||
local label = "Color name" | |||
if table.getn(color_names) > 1 then | |||
label = "Color names" | |||
end | |||
table.insert(infobox_data, {"[[Color notation|" .. label .. "]]", table.concat(color_names, "<br/>")}) | |||
end | |||
if prime_limit < 96 then | if prime_limit < 96 then | ||