Documentation for this module may be created at Module:Namespaces/doc
local p = {}
local function isHiddenOrUseless(id, ns)
-- escludi roba tecnica/di sistema
if id < 0 then return true end
if ns.name == '' then return true end
-- spesso non serve elencare Talk
if ns.isTalk then return true end
-- escludi namespace tipici di sistema (puoi togliere ciò che vuoi)
local blacklist = {
["Special"] = true,
["MediaWiki"] = true,
}
if blacklist[ns.name] then return true end
return false
end
function p.list(frame)
local out = {}
for id, ns in pairs(mw.site.namespaces) do
if not isHiddenOrUseless(id, ns) then
-- Link “home” del namespace: Nome:
local home = string.format("[[%s:|%s:]]", ns.name, ns.name)
-- Link a tutte le pagine del namespace
local allpages = string.format("[[Special:AllPages?namespace=%d|pagine]]", id)
table.insert(out, string.format("* %s (ID %d) – %s", home, id, allpages))
end
end
table.sort(out)
return table.concat(out, "\n")
end
return p