Module:Infobox chord: Difference between revisions

ArrowHead294 (talk | contribs)
m ArrowHead294 moved page Module:Infobox Chord to Module:Infobox chord without leaving a redirect: WP:NCCAPS
ArrowHead294 (talk | contribs)
mNo edit summary
Line 3: Line 3:
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 consistency = require("Module:Chord consistency")
local infobox = require("Module:Infobox")
local infobox = require("Module:Infobox")
local yesno = require("Module:Yesno")


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 212:
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 239: Line 240:


if consistent_edos ~= "" then
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, {"[[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;\">[[Module:Chord consistency/doc|* 2&le;''d''&lt;4; ** 4&le;''d''&lt;8; *** 8&le;''d''&lt;16; &hellip;]]</div>"})
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
else
table.insert(infobox_data, {"[[Consistency|Consistent edos]] (''d''&ge;" .. distance .. ")", "<small>not exist in the range up to 72</small>"})
table.insert(infobox_data, {"[[Consistency|Consistent edos]] (''d'' &ge; " .. distance .. ")", "<small>not exist in the range up to 72</small>"})
end
end
end
end
Line 254: Line 255:


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


return p
return p