<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.bobbyosborne.com:443/index.php?action=history&amp;feed=atom&amp;title=Module%3AHigh-use</id>
	<title>Module:High-use - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.bobbyosborne.com:443/index.php?action=history&amp;feed=atom&amp;title=Module%3AHigh-use"/>
	<link rel="alternate" type="text/html" href="https://wiki.bobbyosborne.com:443/index.php?title=Module:High-use&amp;action=history"/>
	<updated>2026-10-20T05:51:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://wiki.bobbyosborne.com:443/index.php?title=Module:High-use&amp;diff=1352&amp;oldid=prev</id>
		<title>Boj: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.bobbyosborne.com:443/index.php?title=Module:High-use&amp;diff=1352&amp;oldid=prev"/>
		<updated>2026-04-30T23:26:46Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:26, 30 April 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Boj</name></author>
	</entry>
	<entry>
		<id>https://wiki.bobbyosborne.com:443/index.php?title=Module:High-use&amp;diff=1351&amp;oldid=prev</id>
		<title>wikipedia&gt;Ahecht: Per Template talk:High-use#Transcluding nonexistent /testcases pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.bobbyosborne.com:443/index.php?title=Module:High-use&amp;diff=1351&amp;oldid=prev"/>
		<updated>2025-10-08T20:24:46Z</updated>

		<summary type="html">&lt;p&gt;Per &lt;a href=&quot;/index.php?title=Template_talk:High-use&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Template talk:High-use (page does not exist)&quot;&gt;Template talk:High-use#Transcluding nonexistent /testcases pages&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require('strict')&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
local getArgs = require('Module:Arguments').getArgs&lt;br /&gt;
&lt;br /&gt;
local _fetch = require('Module:Transclusion_count')._fetch -- _fetch looks at the 'demo' argument&lt;br /&gt;
local yesno = require('Module:Yesno')&lt;br /&gt;
&lt;br /&gt;
local lang_obj = mw.getContentLanguage() -- this here because the language object is used multiple places in the module&lt;br /&gt;
local large_count_cutoff = 100000&lt;br /&gt;
local approx_num_total_pages = 63000000&lt;br /&gt;
&lt;br /&gt;
local user_subpage_info_page = 'Wikipedia:User pages#SUB'&lt;br /&gt;
local sandbox_module_page = 'Module:Sandbox'&lt;br /&gt;
local system_messages_cat = 'Pages used in system messages needing protection'&lt;br /&gt;
local sandbox_word = 'sandbox'&lt;br /&gt;
local testcases_word = 'testcases'&lt;br /&gt;
local doc_word = 'doc'&lt;br /&gt;
&lt;br /&gt;
local function count_from_args(args)&lt;br /&gt;
	if tonumber(args.count) then -- check if function has already been used&lt;br /&gt;
		return tonumber(args.count) -- early exit if so&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local count&lt;br /&gt;
	&lt;br /&gt;
	if yesno(args['fetch']) ~= false then&lt;br /&gt;
		count = _fetch(args) -- fetch transclusion count&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- use explicitly-provided count when fetch fails&lt;br /&gt;
	if count == nil and args[1] ~= nil and args[1] ~= '' then&lt;br /&gt;
		-- convert local language number string to a number understandable by Lua&lt;br /&gt;
		count = mw.ustring.gsub(args[1], '+$', '')&lt;br /&gt;
		count = lang_obj:parseFormattedNumber(args[1])&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- in case someone writes a non-positive number&lt;br /&gt;
	if count and count &amp;gt; 0 then&lt;br /&gt;
		return count&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Actions if there is a large (greater than or equal to 100,000) transclusion count&lt;br /&gt;
local function risk_boolean(args)&lt;br /&gt;
	if args.risk == true or args.risk == false then&lt;br /&gt;
		return args.risk&lt;br /&gt;
	elseif args[1]  == 'risk' then&lt;br /&gt;
		return true&lt;br /&gt;
	else&lt;br /&gt;
		local count = count_from_args(args)&lt;br /&gt;
		if count and count &amp;gt;= large_count_cutoff then&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- function retained for backwards compatibility&lt;br /&gt;
function p._risk(args)&lt;br /&gt;
	return risk_boolean(args) and 'risk' or ''&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- function retained for backwards compatibility&lt;br /&gt;
function p.risk(frame)&lt;br /&gt;
	return p._risk(getArgs(frame))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- count and no_percent arguments retained for backwards compatibility&lt;br /&gt;
function p._num(args, count, no_percent)&lt;br /&gt;
	if count == nil then&lt;br /&gt;
		count = count_from_args(args)&lt;br /&gt;
	end&lt;br /&gt;
	args.count = count&lt;br /&gt;
	args.risk = risk_boolean(args)&lt;br /&gt;
	&lt;br /&gt;
	-- Build output string&lt;br /&gt;
	local return_value = ''&lt;br /&gt;
	if args.count == nil and args.risk then&lt;br /&gt;
		return 'a very large number of'&lt;br /&gt;
	elseif args.count == nil then&lt;br /&gt;
		return 'many'&lt;br /&gt;
	else&lt;br /&gt;
		-- Use 2 significant figures for smaller numbers and 3 for larger ones&lt;br /&gt;
		local sigfig = 2&lt;br /&gt;
		if args.count &amp;gt;= large_count_cutoff then&lt;br /&gt;
			sigfig = 3&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- Prepare to round to appropriate number of sigfigs&lt;br /&gt;
		local f = math.floor(math.log10(args.count)) - sigfig + 1&lt;br /&gt;
		&lt;br /&gt;
		-- Round and insert 'approximately' or '+' when appropriate&lt;br /&gt;
		if yesno(args[2]) == true or (type(args[1]) == 'string' and (mw.ustring.sub(args[1], -1) == '+')) then&lt;br /&gt;
			-- Round down&lt;br /&gt;
			return_value = string.format('%s+', lang_obj:formatNum(math.floor( (args.count / 10^(f)) ) * (10^(f))) )&lt;br /&gt;
		else&lt;br /&gt;
			-- Round to nearest&lt;br /&gt;
			return_value = string.format('approximately&amp;amp;#x20;%s', lang_obj:formatNum(math.floor( (args.count / 10^(f)) + 0.5) * (10^(f))) )&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- Insert percentage of pages if that is likely to be &amp;gt;= 1% and when |no-percent= not set to yes&lt;br /&gt;
		no_percent = yesno(no_percent or args['no-percent'])&lt;br /&gt;
		if args.count and args.count &amp;gt;= approx_num_total_pages/100 and not no_percent then&lt;br /&gt;
			local num_total_pages = mw.getCurrentFrame():callParserFunction('NUMBEROFPAGES', 'R')&lt;br /&gt;
			local total_percent = math.floor( ( ( args.count/num_total_pages ) * 100) + 0.5)&lt;br /&gt;
			&lt;br /&gt;
			if total_percent &amp;gt;= 1 then&lt;br /&gt;
				return_value = string.format('%s&amp;amp;#x20;pages, or roughly %s%% of all', return_value, total_percent)&lt;br /&gt;
			end&lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return return_value&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- used by [[Template:Stub documentation]] and other pages&lt;br /&gt;
-- count argument retained for backwards compatibility&lt;br /&gt;
function p.num(frame, count)&lt;br /&gt;
	return p._num(getArgs(frame), count)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- count argument retained for backwards compatibility&lt;br /&gt;
function p._text(args, count)&lt;br /&gt;
	--[=[&lt;br /&gt;
		Only show the information about how this template gets updated&lt;br /&gt;
		if someone is actually editing the page and maybe trying to update the count.&lt;br /&gt;
	]=]&lt;br /&gt;
	local bot_text = (mw.getCurrentFrame():preprocess('{{REVISIONID}}') == '') and (&amp;quot;\n\n----\n'''Preview message''':&amp;quot; .. ' Transclusion count updated automatically ([[Template:High-use/doc#Technical details|see documentation]]).') or ''&lt;br /&gt;
	&lt;br /&gt;
	if count == nil then&lt;br /&gt;
		count = count_from_args(args)&lt;br /&gt;
	end&lt;br /&gt;
	args.count = count&lt;br /&gt;
	args.risk = risk_boolean(args)&lt;br /&gt;
	&lt;br /&gt;
	-- trim /doc, /sandbox and /testcases&lt;br /&gt;
	local title = args.title or (args.demo and args.demo ~= '' and mw.title.new(args.demo, 'Template')) or mw.title.getCurrentTitle()&lt;br /&gt;
	if title.subpageText == doc_word or title.subpageText == sandbox_word or title.subpageText == testcases_word then&lt;br /&gt;
		title = title.basePageTitle&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- use /testcases of base template&lt;br /&gt;
	local testcases_page = mw.title.new(title.prefixedText .. '/' .. testcases_word)&lt;br /&gt;
	-- exists is expensive&lt;br /&gt;
	while testcases_page.basePageTitle.isSubpage and not testcases_page.exists do&lt;br /&gt;
		testcases_page = mw.title.new(testcases_page.basePageTitle.basePageTitle.prefixedText .. '/' .. testcases_word)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local systemMessages = (args['system'] or '') ~= ''&lt;br /&gt;
	&lt;br /&gt;
	-- This retrieves the project URL automatically to simplify localization.&lt;br /&gt;
	local templateCount = ('on [https://linkcount.toolforge.org/?project=%s&amp;amp;page=%s#transclusions %s pages]'):format(&lt;br /&gt;
		title:fullUrl():gsub('//(.-)/.*', '%1'),&lt;br /&gt;
		mw.uri.encode(title.fullText), p._num(args))&lt;br /&gt;
	local used_on_text = &amp;quot;'''This &amp;quot; .. (title:inNamespace('Module') and 'Lua module' or 'template') .. ' is used '&lt;br /&gt;
	if systemMessages then&lt;br /&gt;
		used_on_text = used_on_text .. args['system'] ..&lt;br /&gt;
			((args.count and args.count &amp;gt; 2000) and (&amp;quot;''', and &amp;quot; .. templateCount) or (&amp;quot;'''&amp;quot;))&lt;br /&gt;
	else&lt;br /&gt;
		used_on_text = used_on_text .. templateCount .. &amp;quot;'''&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local sandbox_text = ('%s\'s [[%s/sandbox|/sandbox]] or [[%s|/testcases]] subpages, or in your own [[%s]]. '):format(&lt;br /&gt;
		title:inNamespace('Module') and 'module' or 'template',&lt;br /&gt;
		title.fullText,&lt;br /&gt;
		testcases_page.fullText,&lt;br /&gt;
		title:inNamespace('Module') and (sandbox_module_page .. '|module sandbox') or (user_subpage_info_page .. '|user subpage')&lt;br /&gt;
	)&lt;br /&gt;
	&lt;br /&gt;
	local infoArg = args['info'] ~= '' and args['info']&lt;br /&gt;
	if (systemMessages or args.risk) then&lt;br /&gt;
		local info = '.'&lt;br /&gt;
		if systemMessages then&lt;br /&gt;
			info = info .. '&amp;lt;br /&amp;gt;Changes to it can cause immediate changes to the ' .. mw.site.namespaces.Project.name .. ' user interface.'&lt;br /&gt;
		end&lt;br /&gt;
		if infoArg then&lt;br /&gt;
			info = info .. '&amp;lt;br /&amp;gt;' .. infoArg&lt;br /&gt;
		end&lt;br /&gt;
		sandbox_text = info .. '&amp;lt;br /&amp;gt; To avoid major disruption' ..&lt;br /&gt;
			(args.count and args.count &amp;gt;= large_count_cutoff and ' and server load' or '') .. -- should this use args.risk?&lt;br /&gt;
			', any changes should be tested in the ' .. sandbox_text ..&lt;br /&gt;
			'The tested changes can be added to this page in a single edit. '&lt;br /&gt;
	else&lt;br /&gt;
		sandbox_text = (infoArg and ('.&amp;lt;br /&amp;gt;' .. infoArg .. ' C') or ' and c') ..&lt;br /&gt;
			'hanges may be widely noticed. Test changes in the ' .. sandbox_text&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local discussion_text = systemMessages and 'Please discuss changes ' or 'Consider discussing changes '&lt;br /&gt;
	if args[2] ~= nil and args[2] ~= '' and yesno(args[2]) == nil then&lt;br /&gt;
		discussion_text = string.format('%sat [[%s]]', discussion_text, args[2])&lt;br /&gt;
	else&lt;br /&gt;
		discussion_text = string.format('%son the [[%s|talk page]]', discussion_text, title.talkPageTitle.fullText)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return used_on_text .. sandbox_text .. discussion_text .. ' before implementing them.' .. bot_text&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- used by [[Template:R from high-use template]]&lt;br /&gt;
-- count argument retained for backwards compatibility&lt;br /&gt;
function p.text(frame, count)&lt;br /&gt;
	return p._text(getArgs(frame), count)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- nocat argument retained for backwards compatibility&lt;br /&gt;
function p._main(args, nocat)&lt;br /&gt;
	args.count = count_from_args(args)&lt;br /&gt;
	args.risk = risk_boolean(args)&lt;br /&gt;
	args.title = (args.demo and args.demo ~= '' and mw.title.new(args.demo, 'Template')) or mw.title.getCurrentTitle()&lt;br /&gt;
	&lt;br /&gt;
	local image = 'Ambox warning yellow.svg'&lt;br /&gt;
	local type_param = 'style'&lt;br /&gt;
	local epilogue = ''&lt;br /&gt;
	&lt;br /&gt;
	if args['system'] and args['system'] ~= '' then&lt;br /&gt;
		image = 'Ambox important.svg'&lt;br /&gt;
		type_param = 'content'&lt;br /&gt;
		if yesno(nocat or args['nocat']) ~= true and not args.title.isRedirect then&lt;br /&gt;
			local protection_action = (args.title:inNamespace('File') and 'upload') or 'edit'&lt;br /&gt;
			local protection_level = require('Module:Effective protection level')._main(protection_action, args.title.fullText)&lt;br /&gt;
			&lt;br /&gt;
			if protection_level ~= 'sysop' and protection_level ~= 'templateeditor' and protection_level ~= 'interfaceadmin' then&lt;br /&gt;
				epilogue = mw.getCurrentFrame():expandTemplate {&lt;br /&gt;
					title = 'sandbox other',&lt;br /&gt;
					args = {&lt;br /&gt;
						[2] = '[[Category:' .. system_messages_cat .. ']]'&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	elseif args.risk then&lt;br /&gt;
		image = 'Ambox warning orange.svg'&lt;br /&gt;
		type_param = 'content'&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	image = '[[File:' .. image .. '|40px|alt=Warning|link=]]'&lt;br /&gt;
	if args['form'] == 'editnotice' then&lt;br /&gt;
		return mw.getCurrentFrame():expandTemplate{&lt;br /&gt;
				title = 'editnotice',&lt;br /&gt;
				args = {&lt;br /&gt;
						['image'] = image,&lt;br /&gt;
						['text'] = p._text(args),&lt;br /&gt;
						['expiry'] = (args['expiry'] or '')&lt;br /&gt;
				}&lt;br /&gt;
		} .. epilogue&lt;br /&gt;
	else&lt;br /&gt;
		return require('Module:Message box').main('ombox', {&lt;br /&gt;
			type = type_param,&lt;br /&gt;
			image = image,&lt;br /&gt;
			text = p._text(args),&lt;br /&gt;
			expiry = (args['expiry'] or '')&lt;br /&gt;
		}) .. epilogue&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	return p._main(getArgs(frame))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;Ahecht</name></author>
	</entry>
</feed>