Module:Harmonics infobox: Difference between revisions

Sintel (talk | contribs)
Created page with "-- Module:Harmonics infobox -- Infobox for "Harmonics n–2n" and "Subharmonics n–2n" pages. -- Called through Template:Infobox Harmonics and Template:Infobox Subharmonics. local p = {} local getArgs = require("Module:Arguments").getArgs local infobox = require("Module:Infobox") local u = require("Module:Utils") local yesno = require("Module:Yesno") local EN_DASH = "–" -- category names, in one place local CATEGORY = { harmonics = "Overtone scale", subharmonics = "..."
 
Sintel (talk | contribs)
use _infobox, no line break
Line 70: Line 70:
end
end


local title = string.format("%s %d%s%d", sub and "Subharmonics" or "Harmonics", n, EN_DASH, 2 * n)
-- no-wrap: otherwise the caption can break after the en dash
local result = infobox.build(title, data)
local title = string.format(
'<span style="white-space: nowrap;">%s %d%s%d</span>',
sub and "Subharmonics" or "Harmonics",
n,
EN_DASH,
2 * n
)
local result = infobox._infobox({ ["Title"] = title, ["Rows"] = data })
if not debug_mode then
if not debug_mode then
result = result .. categories
result = result .. categories