Module:Navbar: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
m Make code easier to read
Line 14: Line 14:
return "<span style=\"font-size: 0.75em; font-weight: normal; font-style: normal;\">"
return "<span style=\"font-size: 0.75em; font-weight: normal; font-style: normal;\">"
.. text
.. string.format(mode == "mini" and "%s[[%s|V]]%s[[%s|T]]%s[[%s|E]]" or "%s[[%s|View]]%s[[%s|Talk]]%s[[%s|Edit]]",
.. string.format(mode == "mini" and "[[%s|V]]%s[[%s|T]]%s[[%s|E]]" or "[[%s|View]]%s[[%s|Talk]]%s[[%s|Edit]]",
text, p_name, s, p_talk_name, s, p_edit_name)
p_name, s, p_talk_name, s, p_edit_name)
.. "</span>"
.. "</span>"
end
end
Line 43: Line 42:
local idx3 = x + 3
local idx3 = x + 3
local result = "<br />{{Navbox"
local result = "<br />{{Navbox\n"
.. "|name=Navbox Lumatone"
.. "| name = Navbox Lumatone\n"
.. "|Title=[[Lumatone|Lumatone mappings]]"
.. "| Title = [[Lumatone|Lumatone mappings]]\n"
.. "|Data 1={{centre|"
.. "| Data 1 = {{centre|"
if x >= thresh + 4 then
if x >= thresh + 4 then
Line 64: Line 63:
end
end
result = result .. string.format("'''Lumatone mapping for %sedo''' &bull; "
result = result
.. "[[Lumatone mapping for %sedo|%sedo]] &bull; "
.. string.format("'''Lumatone mapping for %sedo''' &bull; ", x)
.. "[[Lumatone mapping for %sedo|%sedo]] &bull; "
.. string.format("[[Lumatone mapping for %sedo|%sedo]] &bull; ", idx1, idx1)
.. "[[Lumatone mapping for %sedo|%sedo]] '''&rarr;'''}}"
.. string.format("[[Lumatone mapping for %sedo|%sedo]] &bull; ", idx2, idx2)
.. "}}", x, idx1, idx1, idx2, idx2, idx3, idx3)
.. string.format("[[Lumatone mapping for %sedo|%sedo]] '''&rarr;'''}}\n", idx3, idx3)
.. "}}"


return frame:preprocess(debugg == true and "<pre>" .. result .. "</pre>" or result)
return frame:preprocess(debugg == true and "<pre>" .. result .. "</pre>" or result)
Line 89: Line 89:
local idx4 = ordinal(x + 4)
local idx4 = ordinal(x + 4)
local result = "<br />{{Navbox"
local result = "<br />{{Navbox\n"
.. "| name=Navbox fractional-octave"
.. "| name = Navbox fractional-octave\n"
.. "| Title=[[Fractional-octave temperaments]]"
.. "| Title = [[Fractional-octave temperaments]]\n"
.. "| Data 1={{centre|"
.. "| Data 1 = {{centre|"
if x >= thresh + 4 then
if x >= thresh + 4 then
Line 114: Line 114:
end
end
result = result .. string.format("'''%s-octave''' &bull; "
result = result
.. "[[%s-octave temperaments|%s]] &bull; "
.. string.format("'''%s-octave''' &bull; ", ordinal(x))
.. "[[%s-octave temperaments|%s]] &bull; "
.. string.format("[[%s-octave temperaments|%s]] &bull; ", idx1, idx1)
.. "[[%s-octave temperaments|%s]] &bull; "
.. string.format("[[%s-octave temperaments|%s]] &bull; ", idx2, idx2)
.. "[[%s-octave temperaments|%s]] '''&rarr;'''}}"
.. string.format("[[%s-octave temperaments|%s]] &bull; ", idx3, idx3)
.. "}}", ordinal(x), idx1, idx1, idx2, idx2, idx3, idx3, idx4, idx4)
.. string.format("[[%s-octave temperaments|%s]] '''&rarr;'''}}\n", idx4, idx4)
.. "}}"


return frame:preprocess(debugg == true and "<pre>" .. result .. "</pre>" or result)
return frame:preprocess(debugg == true and "<pre>" .. result .. "</pre>" or result)