Module:SuperNav

local p = {} local prefixData = mw.loadData('Module:PrefixData') or {} -- The prefixes

--Searching for the prefix corresponding function searchPrefix(pageName) local prefixFound = nil for key, var in ipairs(prefixData) do   if string.find(pageName,var,1,true) ~= nil then prefixFound = var end end return prefixFound end

function makeNav( frame ) local pageName = frame.args["pageName"] -- Getting the title of page using template Auto Nav local prefixUsed = searchPrefix(pageName) return prefixUsed end

return p