Module:Navbar: Difference between revisions
ArrowHead294 (talk | contribs) mNo edit summary |
ArrowHead294 (talk | contribs) mNo edit summary |
||
Line 8: | Line 8: | ||
namespace = namespace or "Template" | namespace = namespace or "Template" | ||
local p_name = | local p_name = string.format("%s:%s", namespace, name) | ||
local p_talk_name = | local p_talk_name = string.format("%s talk:%s", namespace, name) | ||
local p_edit_name = " | local p_edit_name = "special:editpage/" .. p_name | ||
local s = ((mode == "v" or mode == "vmini") and "<br />" or " • ") | local s = ((mode == "v" or mode == "vmini") and "<br />" or " • ") | ||
Line 30: | Line 30: | ||
function p.lumatone_map(frame) | function p.lumatone_map(frame) | ||
local | local arpn = frame:preprocess("{{ARTICLEROOTPAGENAME}}") | ||
local debugg = yesno(frame.args["debug"]) | local debugg = yesno(frame.args["debug"]) | ||
local a = | local a = arpn:match("[Ll]umatone%s*[Mm]apping%s*[Ff]or%s*(%d+)%s*[Ee][Dd][2Oo]") | ||
local x = tonumber(frame.args["edo"]) or tonumber(a) | local x = tonumber(frame.args["edo"]) or tonumber(a) | ||
local thresh = 5 | local thresh = 5 | ||
Line 39: | Line 39: | ||
.. "|name=Navbox Lumatone" | .. "|name=Navbox Lumatone" | ||
.. "|Title=[[Lumatone|Lumatone mappings]]" | .. "|Title=[[Lumatone|Lumatone mappings]]" | ||
.. "|Data 1={{ | .. "|Data 1={{centre|" | ||
.. ((x >= thresh + 4) and "'''←''' " or "") | .. ((x >= thresh + 4) and "'''←''' " or "") | ||
.. ((x >= thresh + 3) and "[[Lumatone mapping for " .. (x - 3) .. "edo|" .. (x - 3) .. "edo]] • " or "") | .. ((x >= thresh + 3) and "[[Lumatone mapping for " .. (x - 3) .. "edo|" .. (x - 3) .. "edo]] • " or "") | ||
Line 50: | Line 50: | ||
.. "}}" | .. "}}" | ||
if string.lower( | if string.lower(arpn) ~= "template:navbox lumatone" then | ||
out_str = out_str .. " [[Category:Lumatone mappings]] [[Category:" .. x .. "edo]]" | out_str = out_str .. " [[Category:Lumatone mappings]] [[Category:" .. x .. "edo]]" | ||
end | end |