Module:Transclusion count/sandbox
< Module:Transclusion count
Jump to navigation
Jump to search
Revision as of 04:37, 10 August 2019 by blackwiki>Ahecht (Allow passing a default value to be used if the lookup fails.)
Documentation for this module may be created at Module:Transclusion count/sandbox/doc
local p = {}
function p.main(frame)
local template = frame.args[2] or mw.title.getCurrentTitle().text
local index = mw.ustring.upper(mw.ustring.sub(template,1,1))
local data = mw.loadData('Module:Transclusion_count/data/' .. (mw.ustring.find(index, "%a") and index or "other"))
return data[template] or frame.args[1] or nil
end
return p