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;\">" | ||
.. 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''' • " | result = result | ||
.. "[[Lumatone mapping for %sedo|%sedo]] • " | .. string.format("'''Lumatone mapping for %sedo''' • ", x) | ||
.. "[[Lumatone mapping for %sedo|%sedo]] • " | .. string.format("[[Lumatone mapping for %sedo|%sedo]] • ", idx1, idx1) | ||
.. "[[Lumatone mapping for %sedo|%sedo]] '''→'''}}" | .. string.format("[[Lumatone mapping for %sedo|%sedo]] • ", idx2, idx2) | ||
.. "}}" | .. string.format("[[Lumatone mapping for %sedo|%sedo]] '''→'''}}\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''' • " | result = result | ||
.. "[[%s-octave temperaments|%s]] • " | .. string.format("'''%s-octave''' • ", ordinal(x)) | ||
.. "[[%s-octave temperaments|%s]] • " | .. string.format("[[%s-octave temperaments|%s]] • ", idx1, idx1) | ||
.. "[[%s-octave temperaments|%s]] • " | .. string.format("[[%s-octave temperaments|%s]] • ", idx2, idx2) | ||
.. "[[%s-octave temperaments|%s]] '''→'''}}" | .. string.format("[[%s-octave temperaments|%s]] • ", idx3, idx3) | ||
.. "}}" | .. string.format("[[%s-octave temperaments|%s]] '''→'''}}\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) |