Module:Infobox chord: Difference between revisions

Dummy index (talk | contribs)
+consistent edos
ArrowHead294 (talk | contribs)
m Alphabetise dependencies
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
local p = {}
local p = {}


local consistency = require("Module:Chord consistency")
local infobox = require("Module:Infobox")
local rat = require("Module:Rational")
local rat = require("Module:Rational")
local utils = require("Module:Utils")
local utils = require("Module:Utils")
local consistency = require('Module:Chord consistency')
local yesno = require("Module:Yesno")
local infobox = require("Module:Infobox")


function p.infobox_chord(frame)
function p.infobox_chord(frame)
local debug_mode = utils.value_provided(frame.args["debug"])
local debug_mode = yesno(frame.args["debug"])
 
local page_name = frame:preprocess("{{PAGENAME}}")
local page_name = frame:preprocess("{{PAGENAME}}")
Line 211: Line 211:
label = "Color names"
label = "Color names"
end
end
table.insert(infobox_data, {"[[Color notation|" .. label .. "]]", table.concat(color_names, "<br/>")})
table.insert(infobox_data, {"[[Color notation|" .. label .. "]]", table.concat(color_names, "<br />")})
end
end


Line 238: Line 238:
table.insert(infobox_data, {"[[Utonal odd limit]]", utonal_odd_limit})
table.insert(infobox_data, {"[[Utonal odd limit]]", utonal_odd_limit})


table.insert(infobox_data, {"Consistent edos (''d''&ge;" .. distance .. ")", consistent_edos})
if consistent_edos ~= "" then
table.insert(infobox_data, {"[[Consistency|Consistent edos]] (''d'' &ge; " .. distance .. ")", "<span style=\"font-size: 75%;\">" .. consistent_edos .. "</span>"})
table.insert(infobox_data, {"<div style=\"font-size: 75%; text-align: right; white-space: nowrap;\">[[Module:Chord consistency/doc|* 2 &le; ''d'' &lt; 4; ** 4 &le; ''d'' &lt; 8; *** 8 &le; ''d'' &lt; 16; &hellip;]]</div>"})
else
table.insert(infobox_data, {"[[Consistency|Consistent edos]] (''d'' &ge; " .. distance .. ")", "<small>not exist in the range up to 72</small>"})
end
end
end
Line 248: Line 253:
end
end


local s = infobox.build("<u>Chord information</u>", infobox_data)
local result = infobox.build("<u>Chord information</u>", infobox_data)
if not debug_mode then
if not debug_mode then
s = s .. cats
result = result .. cats
end
end
return s
return frame:preprocess(result)
end
end


return p
return p