Module:MOS scalesig: Difference between revisions

Ganaram inukshuk (talk | contribs)
m no need for debug option
ArrowHead294 (talk | contribs)
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 12: Line 12:
local is_link = yesno(args["link"], false)
local is_link = yesno(args["link"], false)
local is_long = yesno(args["long"], false)
local is_long = yesno(args["long"], false)
--local debugg = yesno(args["debug"])
local result
function make_scalesig()
if is_link then
if is_link then
-- Text is a link to the mospage
-- Text is a link to the mospage
-- Long link links to and displays "xL ys (p/q-equivalent)"
-- Long link links to and displays "xL ys (p/q-equivalent)"
-- (Short) link instead displays "xL ys<p/q>"
-- (Short) link instead displays "xL ys<p/q>"
-- Has no effect if it's octave-equivalent.
-- Has no effect if it's octave-equivalent.
result = (is_long and mos.as_long_link(input_mos) or mos.as_link(input_mos))
return (is_long and mos.as_long_link(input_mos) or mos.as_link(input_mos))
else
else
-- Text is the scalesig, with nbsp and appropriate brackets added
-- Text is the scalesig, with nbsp and appropriate brackets added
-- Long string displays "xL ys (p/q-equivalent)"
-- Long string displays "xL ys (p/q-equivalent)"
-- (Short) string instead displays "xL ys<p/q>"
-- (Short) string instead displays "xL ys<p/q>"
-- Has no effect if it's octave-equivalent.
-- Has no effect if it's octave-equivalent.
result = (is_long and mos.as_long_string(input_mos) or mos.as_string(input_mos))
return (is_long and mos.as_long_string(input_mos) or mos.as_string(input_mos))
end
end
end
local result = make_scalesig()
-- Debugger option
--if debugg == true then
-- result = "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>"
--end
return frame:preprocess(result)
return frame:preprocess(result)