Module:RemovePrefix
La documentation pour ce module peut être créée à Module:RemovePrefix/doc
local p = {}
function p.removePrefix(frame)
local category = frame.args.category or "CVCandidat"
local prefix = frame.args.prefix or "CVCandidat/"
local pages = mw.site.stats.pagesInCategory(category)
local result = {}
for _, page in ipairs(pages) do
local title = page.title
local displayTitle = mw.ustring.gsub(title, "^" .. prefix, "") -- Retire le préfixe
table.insert(result, string.format("* [[%s|%s]]", title, displayTitle))
end
return table.concat(result, "\n")
end
return p