Changes
Jump to navigation
Jump to search
Line 52:
Line 52:
− table.insert(list, {mw.title.new(name, "Template").fullText, count}) +
+
Line 60:
Line 61:
− +
+
+
+
+
+
+
Module:Transclusion count (view source)
Revision as of 22:36, 11 August 2025
, 22:36, 11 August 2025Add protection level for top 400 rows
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
local title = mw.title.new(name, "Template")
table.insert(list, {title, count})
end
end
end
end
local lang = mw.getContentLanguage();
local lang = mw.getContentLanguage();
for i = 1, #list do
for i = 1, #list do
list[i] = ('|-\n| %d || [[%s]] || %s\n'):format(i, list[i][1]:gsub('_', ' '), lang:formatNum(list[i][2]))
local protLevel = ""
local title = list[i][1]
if i < 400 then
-- Stop at 400 to avoid breaching the expensive parser function call limit
protLevel = title.protectionLevels.edit[1] or "(unprotected)"
end
list[i] = ('|-\n| %d || [[%s]] || %s || %s \n'):format(i, title.fullText:gsub('_', ' '), lang:formatNum(list[i][2]), protLevel)
end
end
return table.concat(list)
return table.concat(list)