Module:Number of works: Difference between revisions

From ProleWiki, the proletarian encyclopedia
(test)
 
No edit summary
Tag: Reverted
Line 5: Line 5:
     local pages = mw.site.stats.pagesInCategory(category)
     local pages = mw.site.stats.pagesInCategory(category)
     return tostring(pages - 1)
     return tostring(pages - 1)
end
function p.main(frame)
    return p.getWorkCount(frame)
end
end


return p
return p

Revision as of 22:07, 4 July 2023

local p = {}

function p.getWorkCount(frame)
    local category = frame.args.category or ''
    local pages = mw.site.stats.pagesInCategory(category)
    return tostring(pages - 1)
end

function p.main(frame)
    return p.getWorkCount(frame)
end

return p