<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://elite.mistflux.co.uk/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ACategory_disambiguation</id>
	<title>Module:Category disambiguation - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://elite.mistflux.co.uk/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ACategory_disambiguation"/>
	<link rel="alternate" type="text/html" href="https://elite.mistflux.co.uk/w/index.php?title=Module:Category_disambiguation&amp;action=history"/>
	<updated>2026-10-31T12:30:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://elite.mistflux.co.uk/w/index.php?title=Module:Category_disambiguation&amp;diff=112396&amp;oldid=prev</id>
		<title>Wikipedia&gt;Lemondoge: Accessibility: Add &quot;|alt=icon&quot; to the icon, because screen readers need text to read in order to announce links (such as linked images) – per MOS:ALT</title>
		<link rel="alternate" type="text/html" href="https://elite.mistflux.co.uk/w/index.php?title=Module:Category_disambiguation&amp;diff=112396&amp;oldid=prev"/>
		<updated>2025-11-27T20:45:11Z</updated>

		<summary type="html">&lt;p&gt;Accessibility: Add &amp;quot;|alt=icon&amp;quot; to the icon, because screen readers need text to read in order to announce links (such as linked images) – per &lt;a href=&quot;/w/index.php?title=MOS:ALT&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;MOS:ALT (page does not exist)&quot;&gt;MOS:ALT&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local concat = table.concat&lt;br /&gt;
local insert = table.insert&lt;br /&gt;
local makeTitle = mw.title.makeTitle&lt;br /&gt;
local messageBox = require(&amp;quot;Module:Message box&amp;quot;).main&lt;br /&gt;
local nowiki = mw.text.nowiki&lt;br /&gt;
local pagesInCategory = mw.site.stats.pagesInCategory&lt;br /&gt;
local remove = table.remove&lt;br /&gt;
local sort = table.sort&lt;br /&gt;
local trim = mw.text.trim&lt;br /&gt;
local yesno = require(&amp;quot;Module:Yesno&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local title = mw.title.getCurrentTitle()&lt;br /&gt;
local namespace = title.namespace&lt;br /&gt;
local title_text = title.text&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args&lt;br /&gt;
	local len, needs_fixing = 0, {}&lt;br /&gt;
	-- Documentation example.&lt;br /&gt;
	if namespace == 10 and title_text:match(&amp;quot;Category disambiguation&amp;quot;) then&lt;br /&gt;
		args = {&lt;br /&gt;
			&amp;quot;the bird genus&amp;quot;,&lt;br /&gt;
			&amp;quot;Eremophila (bird)&amp;quot;,&lt;br /&gt;
			&amp;quot;the plant genus&amp;quot;,&lt;br /&gt;
			&amp;quot;Eremophila (plant)&amp;quot;&lt;br /&gt;
		}&lt;br /&gt;
		len = 4&lt;br /&gt;
	-- Otherwise, process input arguments.&lt;br /&gt;
	else&lt;br /&gt;
		-- Produce a new args table, to get the actual length.&lt;br /&gt;
		-- Trim input arguments, and add various maintenance warnings as needed.&lt;br /&gt;
		args = {}&lt;br /&gt;
		local raw_args = (frame:getParent() or frame).args&lt;br /&gt;
		for k, v in pairs(raw_args) do&lt;br /&gt;
			v = trim(v)&lt;br /&gt;
			if v == &amp;quot;&amp;quot; then&lt;br /&gt;
				v = nil&lt;br /&gt;
			end&lt;br /&gt;
			if type(k) == &amp;quot;number&amp;quot; and k &amp;gt; len then&lt;br /&gt;
				len = k&lt;br /&gt;
			end&lt;br /&gt;
			args[k] = v&lt;br /&gt;
		end&lt;br /&gt;
		-- Number of parameters should be even.&lt;br /&gt;
		local orig_len = len&lt;br /&gt;
		if len % 2 == 1 then&lt;br /&gt;
			-- If odd and the final parameter has content, we need a blank final parameter for the missing category.&lt;br /&gt;
			if args[len] ~= nil then&lt;br /&gt;
				len = len + 1&lt;br /&gt;
			-- If it doesn&amp;#039;t have content and is not preceded by another blank parameter, just ignore it.&lt;br /&gt;
			elseif args[len - 1] ~= nil then&lt;br /&gt;
				len = len - 1&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if len &amp;lt; 4 then&lt;br /&gt;
			insert(needs_fixing, &amp;quot;Should specify at least 2 categories.&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
		-- Fill out any missing parameters, but stop inputs like {{Category disambiguation|10000=foo}} causing a cascade of warnings.&lt;br /&gt;
		local missing, contig_i = 0, 1&lt;br /&gt;
		for i = 1, len do&lt;br /&gt;
			if not args[i] then&lt;br /&gt;
				insert(needs_fixing, &amp;quot;Parameter &amp;quot; .. i .. &amp;quot; &amp;quot; .. (raw_args[i] and &amp;quot;is blank&amp;quot; or &amp;quot;not given&amp;quot;) .. &amp;quot;.&amp;quot;)&lt;br /&gt;
				args[i] = &amp;quot;{{{&amp;quot; .. i .. &amp;quot;}}}&amp;quot;&lt;br /&gt;
				missing = missing + 1&lt;br /&gt;
				if missing &amp;gt;= 10 then&lt;br /&gt;
					error(&amp;quot;Large number of missing parameters between &amp;quot; .. contig_i .. &amp;quot; and &amp;quot; .. orig_len .. &amp;quot; (the highest specified parameter)&amp;quot;)&lt;br /&gt;
				end&lt;br /&gt;
			-- If the large number of missing parameters error needs to be displayed, use the parameter before the first gap as the start of the range containing gaps, or 1 if 1 itself is missing.&lt;br /&gt;
			elseif missing == 0 then&lt;br /&gt;
				contig_i = i&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local list = {}&lt;br /&gt;
	&lt;br /&gt;
	for i = 2, len, 2 do&lt;br /&gt;
		local topic, cat = args[i - 1], args[i]&lt;br /&gt;
		local cat_title = makeTitle(14, cat)&lt;br /&gt;
		-- Warn if the category isn&amp;#039;t valid (e.g. &amp;quot;{&amp;quot; isn&amp;#039;t a valid category name).&lt;br /&gt;
		if not cat_title then&lt;br /&gt;
			insert(needs_fixing, nowiki(cat) .. &amp;quot; is not a valid category title.&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
		insert(list, &amp;quot;* For &amp;quot; .. topic .. &amp;quot;, see &amp;#039;&amp;#039;&amp;#039;[[:&amp;quot; .. (cat_title and cat_title.prefixedText or &amp;quot;Category:&amp;quot; .. cat) .. &amp;quot;]].&amp;#039;&amp;#039;&amp;#039;&amp;quot;)&lt;br /&gt;
		-- Warn if the category is a redlink.&lt;br /&gt;
		if cat_title and not (yesno(args.allowredlink, true) or cat_title.exists) then&lt;br /&gt;
			insert(needs_fixing, cat_title.prefixedText .. &amp;quot; is a redlink.&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local output = messageBox(&amp;quot;cmbox&amp;quot;, {&lt;br /&gt;
		type  = &amp;quot;content&amp;quot;,&lt;br /&gt;
		image = &amp;quot;[[File:Disambig gray.svg|50px|alt=icon]]&amp;quot;,&lt;br /&gt;
		text = &amp;quot;&amp;#039;&amp;#039;&amp;#039;This category is not in use because it has an ambiguous title.&amp;#039;&amp;#039;&amp;#039;&amp;quot; .. &lt;br /&gt;
			frame:expandTemplate{&lt;br /&gt;
				title = &amp;quot;Plainlist&amp;quot;,&lt;br /&gt;
				args = {&lt;br /&gt;
					concat(list, &amp;quot;\n&amp;quot;),&lt;br /&gt;
					style = &amp;quot;margin-left:1.6em;&amp;quot;&lt;br /&gt;
				}&lt;br /&gt;
			} ..&lt;br /&gt;
			&amp;quot;&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; This category page should be empty.  All entries should be recategorized under one of the above categories or an appropriate subcategory.&amp;quot;&lt;br /&gt;
	})&lt;br /&gt;
	&lt;br /&gt;
	-- Add maintenance warnings if necessary.&lt;br /&gt;
	if #needs_fixing &amp;gt; 0 then&lt;br /&gt;
		sort(needs_fixing)&lt;br /&gt;
		output = output .. messageBox(&amp;quot;cmbox&amp;quot;, {&lt;br /&gt;
			type  = &amp;quot;style&amp;quot;,&lt;br /&gt;
			text = frame:expandTemplate{&lt;br /&gt;
					title = &amp;quot;Template link&amp;quot;,&lt;br /&gt;
					args = {&lt;br /&gt;
						&amp;quot;Category disambiguation&amp;quot;&lt;br /&gt;
					}&lt;br /&gt;
				} .. &amp;quot; has the following issues:&amp;quot; .. &lt;br /&gt;
				frame:expandTemplate{&lt;br /&gt;
					title = &amp;quot;Plainlist&amp;quot;,&lt;br /&gt;
					args = {&lt;br /&gt;
						&amp;quot;*&amp;quot; .. concat(needs_fixing, &amp;quot;\n*&amp;quot;),&lt;br /&gt;
						style = &amp;quot;margin-left:1.6em;&amp;quot;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
		})&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Only add behaviour switches and categories if in the category namespace.&lt;br /&gt;
	if namespace == 14 then&lt;br /&gt;
		output = output ..&lt;br /&gt;
			&amp;quot;__DISAMBIG__&amp;quot; ..&lt;br /&gt;
			&amp;quot;__EXPECTUNUSEDCATEGORY__&amp;quot; ..&lt;br /&gt;
			&amp;quot;[[Category:Disambiguation categories]]&amp;quot; ..&lt;br /&gt;
			&amp;quot;[[Category:All disambiguation pages]]&amp;quot; ..&lt;br /&gt;
			(#needs_fixing &amp;gt; 0 and &amp;quot;[[Category:Wikipedia category-disambiguation box parameter needs fixing|∃&amp;quot; ..&lt;br /&gt;
		title_text .. &amp;quot;]]&amp;quot; or &amp;quot;&amp;quot;) ..&lt;br /&gt;
			(pagesInCategory(title_text) &amp;gt; 0 and &amp;quot;[[Category:Non-empty disambiguation categories]]&amp;quot; or &amp;quot;&amp;quot;)&lt;br /&gt;
	elseif not yesno(args.nocat, true) then&lt;br /&gt;
		output = output .. frame:expandTemplate{&lt;br /&gt;
			title = &amp;quot;Incorrect namespace&amp;quot;,&lt;br /&gt;
			args = {&lt;br /&gt;
				&amp;quot;category&amp;quot;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return output&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Wikipedia&gt;Lemondoge</name></author>
	</entry>
</feed>