local p = {}
function p.fetch(frame)
local template = nil
local return_value = nil
if frame.args["demo"] and frame.args["demo"] ~= "" then
template = frame.args["demo"]
elseif mw.title.getCurrentTitle().namespace == 10 then
template = mw.title.getCurrentTitle().text
end
if template ~= nil and mw.title.new(template, "Template").namespace == 10 then
template = mw.ustring.gsub(template, "/doc$", "")
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_value = tonumber(data[mw.ustring.gsub(template, " ", "_")])
end