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( | 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 = | 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''≥" .. distance .. ")", "<span style=\"font-size: 75%;\">" .. consistent_edos .. "</span>"}) | table.insert(infobox_data, {"[[Consistency|Consistent edos]] (''d'' ≥ " .. 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≤''d''<4; ** 4≤''d''<8; *** 8≤''d''<16; …]]</div>"}) | table.insert(infobox_data, {"<div style=\"font-size: 75%; text-align: right; white-space: nowrap;\">[[Module:Chord consistency/doc|* 2 ≤ ''d'' < 4; ** 4 ≤ ''d'' < 8; *** 8 ≤ ''d'' < 16; …]]</div>"}) | ||
else | else | ||
table.insert(infobox_data, {"[[Consistency|Consistent edos]] (''d''≥" .. distance .. ")", "<small>not exist in the range up to 72</small>"}) | table.insert(infobox_data, {"[[Consistency|Consistent edos]] (''d'' ≥ " .. 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) | ||
return frame:preprocess(debug_mode == true and "<pre>" .. s .. "</pre>" or s .. cats) | |||
end | end | ||
return p | return p |