Module:High-use: Difference between revisions

Edited an annotation
No edit summary
(Edited an annotation)
Line 1:
local p = {}
 
local _fetch = require('Module:Transclusion_count').fetch
 
function p.num(frame, count)
if count == nil then count = _fetch(frame) end
-- Build output string
local return_value = ""
Line 11 ⟶ 15:
end
else
-- Use 2 sigfigssignificant figures for smaller numbers and 3 for larger ones
local sigfig = 2
if count >= 100000 then
Line 51 ⟶ 55:
 
function p.text(frame, count)
if count == nil then count = _fetch(frame) end
local return_value = {}
Line 58 ⟶ 63:
end
local templatecount = string.format("https://tools.wmflabs.org/templatecount/index.php?lang=en&namespace=%s&name=%s",mw.title.getCurrentTitle().namespace,mw.uri.encode(title.text))
local used_on_text = string.format("'''This %s is used on %s pages'''",
local used_on_text = string.format("'''This %s is used on [%s %s pages]'''",
(mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template"),
templatecount,
p.num(frame, count)
)
Line 66 ⟶ 74:
(mw.title.getCurrentTitle().namespace == 828 and "module" or "template"),
title.fullText, title.fullText,
(mw.title.getCurrentTitle().namespace == 828 and "." or ", or in your own [[Wikipedia:Subpages#How to create user subpages|user subpage]].")
)
Line 94 ⟶ 102:
 
function p.main(frame)
local arg1count = mw.ustring.match_fetch(frame.args[1], '[%d,]+')
local count = tonumber(frame:callParserFunction('formatnum', arg1, 'R'))
local return_value = ""
local image = "[[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]"
Anonymous user