Jump to content

Module:ArticleSize

From Calamity Wiki
Revision as of 07:40, 22 July 2024 by imported>ModulationBend (Measures article size in real time)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:ArticleSize/doc

local p = {}

function p.size(frame)
    local title = frame.args[1] or mw.title.getCurrentTitle().text
    local page = mw.title.new(title)
    local content = page and page:getContent() or ""
    local size = #content
    return mw.language.getContentLanguage():formatNum(size)
end

return p