Module:MOS intro: Difference between revisions

Ganaram inukshuk (talk | contribs)
"deprecated template parameters" -> "deprecated parameters"
ArrowHead294 (talk | contribs)
m +Debugging option
Line 5: Line 5:
local tip = require("Module:Template input parse")
local tip = require("Module:Template input parse")
local tamnams = require("Module:TAMNAMS")
local tamnams = require("Module:TAMNAMS")
local yesno = require("Module:Yesno")
local p = {}
local p = {}


Line 241: Line 242:
-- Add repetition
-- Add repetition
if n == 1 then
if n == 1 then
intro = intro .. ", repeating every " .. (equave_in_cents == 1200 and "[[octave]]." or string.format(" interval of [[%s]] (%.1f¢).", equave_as_ratio, equave_in_cents, round))
intro = intro .. ", repeating every " .. (equave_in_cents == 1200 and "[[octave]]." or string.format(" interval of [[%s]] (%.1f{{c}}).", equave_as_ratio, equave_in_cents, round))
else
else
intro = intro .. string.format(", with a [[period]] of %d large %s", nL/n, (nL/n == 1 and "step" or "steps"))
intro = intro .. string.format(", with a [[period]] of %d large %s", nL/n, (nL/n == 1 and "step" or "steps"))
intro = intro .. string.format(" and %d small %s", ns/n, (ns/n == 1 and "step" or "steps"))
intro = intro .. string.format(" and %d small %s", ns/n, (ns/n == 1 and "step" or "steps"))
intro = intro .. string.format(" that repeats every %.1f¢", period_in_cents)
intro = intro .. string.format(" that repeats every %.1f{{c}}", period_in_cents)
intro = intro .. (n == 2 and ", or twice every" or string.format(", or %d times every", n)) .. (equave_in_cents == 1200 and " octave." or string.format(" interval of [[%s]] (%.1f¢).", equave_as_ratio, equave_in_cents, round))
intro = intro .. (n == 2 and ", or twice every" or string.format(", or %d times every", n)) .. (equave_in_cents == 1200 and " octave." or string.format(" interval of [[%s]] (%.1f¢).", equave_as_ratio, equave_in_cents, round))
end
end
Line 276: Line 277:
local dark_gen_max_r = tostring(utils._round_dec(dark_gen_max, round))
local dark_gen_max_r = tostring(utils._round_dec(dark_gen_max, round))
intro = intro .. string.format(" [[generator|Generators]] that produce this scale range from %to %, or from %to %.", bright_gen_min_r, bright_gen_max_r, dark_gen_min_r, dark_gen_max_r)
intro = intro .. string.format(" [[generator|Generators]] that produce this scale range from %s{{c}} to %s{{c}}, or from %s{{c}} to %s{{c}}.", bright_gen_min_r, bright_gen_max_r, dark_gen_min_r, dark_gen_max_r)
-- Rothenberg propriety (rothenprop) info
-- Rothenberg propriety (rothenprop) info
Line 297: Line 298:
local depparams = other_names ~= "" and " [[Category:Pages with deprecated parameters]]" or ""
local depparams = other_names ~= "" and " [[Category:Pages with deprecated parameters]]" or ""
return p._mos_intro(input_mos, other_names) .. depparams
    local result = p._mos_intro(input_mos, other_names) .. depparams
    local debugg = yesno(frame.args["debug"])
    return frame:preprocess(debugg == true and "<pre>" .. result .. "</pre>" or result)
end
end


return p
return p