Module:Powharmonic series: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
local yesno = require("Module:yesno")
local p = {}
local p = {}
local yesno = require("Module:Yesno")


function p.powharmonic(frame)
function p.powharmonic(frame)
Line 6: Line 7:
     local expo = tonumber(frame.args["expo"])
     local expo = tonumber(frame.args["expo"])
     local result = "{| class=\"wikitable center-all\"\n"
     local result = "{| class=\"wikitable center-all\"\n"
    .. "|+ style=\"font-size: 105%;\" | " .. string.format("Intervals of the %s-Powharmonic series\n", expo)
    .. "|+ style=\"font-size: 105%; white-space: nowrap;\" | " .. string.format("Intervals of the %s-Powharmonic series\n", expo)
    .. "|-\n"
    .. "|-\n"
    .. "! rowspan=\"2\" | Pitch !! colspan=\"2\" | Frequency multiplier !! colspan=\"3\" | Pitch\n"
    .. "! rowspan=\"2\" | Pitch !! colspan=\"2\" | Frequency multiplier !! colspan=\"3\" | Pitch\n"
Line 32: Line 33:
     result = result .. "|}"
     result = result .. "|}"
      
      
    -- Debugger option
     local debugg = yesno(frame.args["debug"])
     local debugg = yesno(frame.args["debug"])
     return frame:preprocess(debugg == true and "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>" or result)
     if debugg == true then
result = "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>"
end
return frame:preprocess(result)
end
end


return p
return p