Modul:Transclusion count: Unterschied zwischen den Versionen

K
19 Versionen von wpen:Module:Transclusion_count importiert
(Sort alphabetically after sorting by count)
K (19 Versionen von wpen:Module:Transclusion_count importiert)
 
(3 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 8: Zeile 8:
local namespace = mw.title.getCurrentTitle().namespace
local namespace = mw.title.getCurrentTitle().namespace
if frame.args["demo"] and frame.args["demo"] ~= "" then
if frame.args["demo"] and frame.args["demo"] ~= "" then
template = frame.args["demo"]
template = mw.ustring.gsub(frame.args["demo"],"^[Tt]emplate:","")
elseif namespace == 10 then -- Template namespace
elseif namespace == 10 then -- Template namespace
template = mw.title.getCurrentTitle().text
template = mw.title.getCurrentTitle().text
Zeile 20: Zeile 20:
if namespace == 10 or namespace == 828 then
if namespace == 10 or namespace == 828 then
template =  mw.ustring.gsub(template, "/doc$", "") -- strip /doc from end
template =  mw.ustring.gsub(template, "/doc$", "") -- strip /doc from end
template =  mw.ustring.gsub(template, "/sandbox$", "") -- strip /sandbox from end
local index = mw.ustring.sub(mw.title.new(template).text,1,1)
local index = mw.ustring.sub(mw.title.new(template).text,1,1)
local status, data = pcall(function ()  
local status, data = pcall(function ()  
Zeile 47: Zeile 48:
local data = mw.loadData('Module:Transclusion count/data/' .. ((i == 91) and 'other' or string.char(i)))
local data = mw.loadData('Module:Transclusion count/data/' .. ((i == 91) and 'other' or string.char(i)))
for name, count in pairs(data) do
for name, count in pairs(data) do
if not name:find(':') then
table.insert(list, {mw.title.new(name, "Template").fullText, count})
name = 'Template:' .. name
end
table.insert(list, {name, count})
end
end
end
end