- This module should not be invoked directly; use its corresponding template instead: Template:MOS scalesig.
Module:MOS scalesig formats a string into a mos scale signature, with non-breaking spaces and, if non-octave, the appropriate brackets. Scale signatures can optionally be formatted as a link to the scale's wiki page.
| Introspection summary for Module:MOS scalesig
|
Functions provided (3)
| Line
|
Function
|
Params
|
| 6
|
_mos_scalesig (main)
|
(input_mos, is_link, is_long)
|
| 16
|
mos_scalesig (invokable)
|
(frame)
|
| 26
|
tester
|
none
|
|
|
No function descriptions were provided. The Lua code may have further information.
local mos = require("Module:MOS")
local yesno = require("Module:Yesno")
local getArgs = require("Module:Arguments").getArgs
local p = {}
function p._mos_scalesig(input_mos, is_link, is_long)
local is_link = yesno(is_link, false) -- Is the scalesig a link?
local is_long = yesno(is_long, false) -- Is the scalesig in the long form "xL ys (p/q-equivalent)"?
return (is_link == true
and (is_long and mos.as_long_link(input_mos) or mos.as_link(input_mos))
or (is_long and mos.as_long_string(input_mos) or mos.as_string(input_mos)))
end
-- Wrapper function
function p.mos_scalesig(frame)
local args = getArgs(frame)
local input_mos = mos.parse(args["scalesig"])
local is_link = yesno(args["link"], false)
local is_long = yesno(args["long"], false)
return p._mos_scalesig(input_mos, is_link, is_long)
end
function p.tester()
local input_mos = mos.new(5, 2)
return p._mos_scalesig(input_mos, true, true)
end
return p