Module:Navbar: Difference between revisions

ArrowHead294 (talk | contribs)
Consolidated navigation bar functions
 
ArrowHead294 (talk | contribs)
mNo edit summary
Line 30: Line 30:


function p.frac_octave(frame)
function p.frac_octave(frame)
local args = frame.args
if args[1] == nil then
args = frame:getParent().args
end
if args[1] == nil then
args[1] = "{{{1|}}}"
end
local root_page_name = frame:preprocess("{{ROOTPAGENAME}}")
local root_page_name = frame:preprocess("{{ROOTPAGENAME}}")
local a = root_page_name:match("(%d+)%a+[%s%-]*[Oo]ctave%s*[Tt]emperament[s]?")
local a = root_page_name:match("(%d+)%a+[%s%-]*[Oo]ctave%s*[Tt]emperament[s]?")
local x = tonumber(args[1]) or tonumber(a)
local x = tonumber(frame.args["f"]) or tonumber(a)
local out_str = frame:preprocess("{{Navbox"
local out_str = frame:preprocess("{{Navbox"