Module:Harmonics infobox: Difference between revisions
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 = "..." |
use _infobox, no line break |
||
| Line 70: | Line 70: | ||
end | end | ||
local title = string.format("%s %d%s%d | -- no-wrap: otherwise the caption can break after the en dash | ||
local result = infobox. | 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 | ||