<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tulip.aspertia.city/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://tulip.aspertia.city/index.php?action=history&amp;feed=atom&amp;title=Module%3AHigh-use"/>
	<link rel="alternate" type="text/html" href="https://tulip.aspertia.city/index.php?title=Module:High-use&amp;action=history"/>
	<updated>2026-04-05T12:05:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://tulip.aspertia.city/index.php?title=Module:High-use&amp;diff=133&amp;oldid=prev</id>
		<title>Admin: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://tulip.aspertia.city/index.php?title=Module:High-use&amp;diff=133&amp;oldid=prev"/>
		<updated>2026-04-04T13:12:40Z</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;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:12, 4 April 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&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;!-- diff cache key mediawiki:diff:1.41:old-132:rev-133 --&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://tulip.aspertia.city/index.php?title=Module:High-use&amp;diff=132&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://tulip.aspertia.city/index.php?title=Module:High-use&amp;diff=132&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(&amp;#039;strict&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
&lt;br /&gt;
local _fetch = require(&amp;#039;Module:Transclusion_count&amp;#039;)._fetch -- _fetch looks at the &amp;#039;demo&amp;#039; argument&lt;br /&gt;
local yesno = require(&amp;#039;Module:Yesno&amp;#039;)&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 = &amp;#039;Wikipedia:User pages#SUB&amp;#039;&lt;br /&gt;
local sandbox_module_page = &amp;#039;Module:Sandbox&amp;#039;&lt;br /&gt;
local system_messages_cat = &amp;#039;Pages used in system messages needing protection&amp;#039;&lt;br /&gt;
local sandbox_word = &amp;#039;sandbox&amp;#039;&lt;br /&gt;
local testcases_word = &amp;#039;testcases&amp;#039;&lt;br /&gt;
local doc_word = &amp;#039;doc&amp;#039;&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[&amp;#039;fetch&amp;#039;]) ~= 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] ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		-- convert local language number string to a number understandable by Lua&lt;br /&gt;
		count = mw.ustring.gsub(args[1], &amp;#039;+$&amp;#039;, &amp;#039;&amp;#039;)&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]  == &amp;#039;risk&amp;#039; 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 &amp;#039;risk&amp;#039; or &amp;#039;&amp;#039;&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 = &amp;#039;&amp;#039;&lt;br /&gt;
	if args.count == nil and args.risk then&lt;br /&gt;
		return &amp;#039;a very large number of&amp;#039;&lt;br /&gt;
	elseif args.count == nil then&lt;br /&gt;
		return &amp;#039;many&amp;#039;&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 &amp;#039;approximately&amp;#039; or &amp;#039;+&amp;#039; when appropriate&lt;br /&gt;
		if yesno(args[2]) == true or (type(args[1]) == &amp;#039;string&amp;#039; and (mw.ustring.sub(args[1], -1) == &amp;#039;+&amp;#039;)) then&lt;br /&gt;
			-- Round down&lt;br /&gt;
			return_value = string.format(&amp;#039;%s+&amp;#039;, 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(&amp;#039;approximately&amp;amp;#x20;%s&amp;#039;, 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[&amp;#039;no-percent&amp;#039;])&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(&amp;#039;NUMBEROFPAGES&amp;#039;, &amp;#039;R&amp;#039;)&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(&amp;#039;%s&amp;amp;#x20;pages, or roughly %s%% of all&amp;#039;, 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(&amp;#039;{{REVISIONID}}&amp;#039;) == &amp;#039;&amp;#039;) and (&amp;quot;\n\n----\n&amp;#039;&amp;#039;&amp;#039;Preview message&amp;#039;&amp;#039;&amp;#039;:&amp;quot; .. &amp;#039; Transclusion count updated automatically ([[Template:High-use/doc#Technical details|see documentation]]).&amp;#039;) or &amp;#039;&amp;#039;&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 ~= &amp;#039;&amp;#039; and mw.title.new(args.demo, &amp;#039;Template&amp;#039;)) 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 .. &amp;#039;/&amp;#039; .. 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 .. &amp;#039;/&amp;#039; .. testcases_word)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local systemMessages = (args[&amp;#039;system&amp;#039;] or &amp;#039;&amp;#039;) ~= &amp;#039;&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	-- This retrieves the project URL automatically to simplify localization.&lt;br /&gt;
	local templateCount = (&amp;#039;on [https://linkcount.toolforge.org/?project=%s&amp;amp;page=%s#transclusions %s pages]&amp;#039;):format(&lt;br /&gt;
		title:fullUrl():gsub(&amp;#039;//(.-)/.*&amp;#039;, &amp;#039;%1&amp;#039;),&lt;br /&gt;
		mw.uri.encode(title.fullText), p._num(args))&lt;br /&gt;
	local used_on_text = &amp;quot;&amp;#039;&amp;#039;&amp;#039;This &amp;quot; .. (title:inNamespace(&amp;#039;Module&amp;#039;) and &amp;#039;Lua module&amp;#039; or &amp;#039;template&amp;#039;) .. &amp;#039; is used &amp;#039;&lt;br /&gt;
	if systemMessages then&lt;br /&gt;
		used_on_text = used_on_text .. args[&amp;#039;system&amp;#039;] ..&lt;br /&gt;
			((args.count and args.count &amp;gt; 2000) and (&amp;quot;&amp;#039;&amp;#039;&amp;#039;, and &amp;quot; .. templateCount) or (&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;quot;))&lt;br /&gt;
	else&lt;br /&gt;
		used_on_text = used_on_text .. templateCount .. &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local sandbox_text = (&amp;#039;%s\&amp;#039;s [[%s/sandbox|/sandbox]] or [[%s|/testcases]] subpages, or in your own [[%s]]. &amp;#039;):format(&lt;br /&gt;
		title:inNamespace(&amp;#039;Module&amp;#039;) and &amp;#039;module&amp;#039; or &amp;#039;template&amp;#039;,&lt;br /&gt;
		title.fullText,&lt;br /&gt;
		testcases_page.fullText,&lt;br /&gt;
		title:inNamespace(&amp;#039;Module&amp;#039;) and (sandbox_module_page .. &amp;#039;|module sandbox&amp;#039;) or (user_subpage_info_page .. &amp;#039;|user subpage&amp;#039;)&lt;br /&gt;
	)&lt;br /&gt;
	&lt;br /&gt;
	local infoArg = args[&amp;#039;info&amp;#039;] ~= &amp;#039;&amp;#039; and args[&amp;#039;info&amp;#039;]&lt;br /&gt;
	if (systemMessages or args.risk) then&lt;br /&gt;
		local info = &amp;#039;.&amp;#039;&lt;br /&gt;
		if systemMessages then&lt;br /&gt;
			info = info .. &amp;#039;&amp;lt;br /&amp;gt;Changes to it can cause immediate changes to the &amp;#039; .. mw.site.namespaces.Project.name .. &amp;#039; user interface.&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		if infoArg then&lt;br /&gt;
			info = info .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. infoArg&lt;br /&gt;
		end&lt;br /&gt;
		sandbox_text = info .. &amp;#039;&amp;lt;br /&amp;gt; To avoid major disruption&amp;#039; ..&lt;br /&gt;
			(args.count and args.count &amp;gt;= large_count_cutoff and &amp;#039; and server load&amp;#039; or &amp;#039;&amp;#039;) .. -- should this use args.risk?&lt;br /&gt;
			&amp;#039;, any changes should be tested in the &amp;#039; .. sandbox_text ..&lt;br /&gt;
			&amp;#039;The tested changes can be added to this page in a single edit. &amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		sandbox_text = (infoArg and (&amp;#039;.&amp;lt;br /&amp;gt;&amp;#039; .. infoArg .. &amp;#039; C&amp;#039;) or &amp;#039; and c&amp;#039;) ..&lt;br /&gt;
			&amp;#039;hanges may be widely noticed. Test changes in the &amp;#039; .. sandbox_text&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local discussion_text = systemMessages and &amp;#039;Please discuss changes &amp;#039; or &amp;#039;Consider discussing changes &amp;#039;&lt;br /&gt;
	if args[2] ~= nil and args[2] ~= &amp;#039;&amp;#039; and yesno(args[2]) == nil then&lt;br /&gt;
		discussion_text = string.format(&amp;#039;%sat [[%s]]&amp;#039;, discussion_text, args[2])&lt;br /&gt;
	else&lt;br /&gt;
		discussion_text = string.format(&amp;#039;%son the [[%s|talk page]]&amp;#039;, discussion_text, title.talkPageTitle.fullText)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return used_on_text .. sandbox_text .. discussion_text .. &amp;#039; before implementing them.&amp;#039; .. 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 ~= &amp;#039;&amp;#039; and mw.title.new(args.demo, &amp;#039;Template&amp;#039;)) or mw.title.getCurrentTitle()&lt;br /&gt;
	&lt;br /&gt;
	local image = &amp;#039;Ambox warning yellow.svg&amp;#039;&lt;br /&gt;
	local type_param = &amp;#039;style&amp;#039;&lt;br /&gt;
	local epilogue = &amp;#039;&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	if args[&amp;#039;system&amp;#039;] and args[&amp;#039;system&amp;#039;] ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		image = &amp;#039;Ambox important.svg&amp;#039;&lt;br /&gt;
		type_param = &amp;#039;content&amp;#039;&lt;br /&gt;
		if yesno(nocat or args[&amp;#039;nocat&amp;#039;]) ~= true and not args.title.isRedirect then&lt;br /&gt;
			local protection_action = (args.title:inNamespace(&amp;#039;File&amp;#039;) and &amp;#039;upload&amp;#039;) or &amp;#039;edit&amp;#039;&lt;br /&gt;
			local protection_level = require(&amp;#039;Module:Effective protection level&amp;#039;)._main(protection_action, args.title.fullText)&lt;br /&gt;
			&lt;br /&gt;
			if protection_level ~= &amp;#039;sysop&amp;#039; and protection_level ~= &amp;#039;templateeditor&amp;#039; and protection_level ~= &amp;#039;interfaceadmin&amp;#039; then&lt;br /&gt;
				epilogue = mw.getCurrentFrame():expandTemplate {&lt;br /&gt;
					title = &amp;#039;sandbox other&amp;#039;,&lt;br /&gt;
					args = {&lt;br /&gt;
						[2] = &amp;#039;[[Category:&amp;#039; .. system_messages_cat .. &amp;#039;]]&amp;#039;&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 = &amp;#039;Ambox warning orange.svg&amp;#039;&lt;br /&gt;
		type_param = &amp;#039;content&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	image = &amp;#039;[[File:&amp;#039; .. image .. &amp;#039;|40px|alt=Warning|link=]]&amp;#039;&lt;br /&gt;
	if args[&amp;#039;form&amp;#039;] == &amp;#039;editnotice&amp;#039; then&lt;br /&gt;
		return mw.getCurrentFrame():expandTemplate{&lt;br /&gt;
				title = &amp;#039;editnotice&amp;#039;,&lt;br /&gt;
				args = {&lt;br /&gt;
						[&amp;#039;image&amp;#039;] = image,&lt;br /&gt;
						[&amp;#039;text&amp;#039;] = p._text(args),&lt;br /&gt;
						[&amp;#039;expiry&amp;#039;] = (args[&amp;#039;expiry&amp;#039;] or &amp;#039;&amp;#039;)&lt;br /&gt;
				}&lt;br /&gt;
		} .. epilogue&lt;br /&gt;
	else&lt;br /&gt;
		return require(&amp;#039;Module:Message box&amp;#039;).main(&amp;#039;ombox&amp;#039;, {&lt;br /&gt;
			type = type_param,&lt;br /&gt;
			image = image,&lt;br /&gt;
			text = p._text(args),&lt;br /&gt;
			expiry = (args[&amp;#039;expiry&amp;#039;] or &amp;#039;&amp;#039;)&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>