<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pool.calebcooper.ie/index.php?action=history&amp;feed=atom&amp;title=Module%3ARedirect_template</id>
	<title>Module:Redirect template - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pool.calebcooper.ie/index.php?action=history&amp;feed=atom&amp;title=Module%3ARedirect_template"/>
	<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Module:Redirect_template&amp;action=history"/>
	<updated>2026-06-06T06:01:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://pool.calebcooper.ie/index.php?title=Module:Redirect_template&amp;diff=15078&amp;oldid=prev</id>
		<title>Caleb Cooper: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Module:Redirect_template&amp;diff=15078&amp;oldid=prev"/>
		<updated>2020-10-30T22:28:03Z</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 22:28, 30 October 2020&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>Caleb Cooper</name></author>
	</entry>
	<entry>
		<id>https://pool.calebcooper.ie/index.php?title=Module:Redirect_template&amp;diff=15077&amp;oldid=prev</id>
		<title>wikipedia&gt;SD0001: replace class param with a new id param for better parsing by scripts (class param was added by me in Jan 2019; it&#039;s completely unused and was never documented anywhere)</title>
		<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Module:Redirect_template&amp;diff=15077&amp;oldid=prev"/>
		<updated>2020-10-24T08:07:11Z</updated>

		<summary type="html">&lt;p&gt;replace class param with a new id param for better parsing by scripts (class param was added by me in Jan 2019; it&amp;#039;s completely unused and was never documented anywhere)&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 08:07, 24 October 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 46:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 46:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	local content = string.format(&#039;\n&amp;lt;div class=&quot;rcat %s&quot;&amp;gt;\n*%sThis is a redirect%s%s.%s%s\n&amp;lt;/div&amp;gt;&#039;,&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	local content = string.format(&#039;\n&amp;lt;div class=&quot;rcat %s&quot;&amp;gt;\n*%sThis is a redirect%s%s.%s%s\n&amp;lt;/div&amp;gt;&#039;,&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		args.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;class&lt;/del&gt; or &#039;&#039;,&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		args.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;id and (&#039;rcat-&#039; .. string.gsub(args.id, &#039; &#039;, &#039;_&#039;))&lt;/ins&gt; or &#039;&#039;,&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		args.name and getPrettyName(args) or &#039;&#039;,&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		args.name and getPrettyName(args) or &#039;&#039;,&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		args.from and (&#039; from &#039; .. args.from) or &#039;&#039;,&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		args.from and (&#039; from &#039; .. args.from) or &#039;&#039;,&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>wikipedia&gt;SD0001</name></author>
	</entry>
	<entry>
		<id>https://pool.calebcooper.ie/index.php?title=Module:Redirect_template&amp;diff=11756&amp;oldid=prev</id>
		<title>Caleb Cooper: Created page with &quot;require(&#039;Module:No globals&#039;)  local p = {}  -- key is beginning of arg name. value is table with namespace number and link -- alternatively, a function taking the namespace nu...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Module:Redirect_template&amp;diff=11756&amp;oldid=prev"/>
		<updated>2020-10-16T09:27:09Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;require(&amp;#039;Module:No globals&amp;#039;)  local p = {}  -- key is beginning of arg name. value is table with namespace number and link -- alternatively, a function taking the namespace nu...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require(&amp;#039;Module:No globals&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- key is beginning of arg name. value is table with namespace number and link&lt;br /&gt;
-- alternatively, a function taking the namespace number and returning a validity&lt;br /&gt;
-- can be used&lt;br /&gt;
local namespaceCategories = {&lt;br /&gt;
	all = { function() return true end },&lt;br /&gt;
	main = { 0, &amp;#039;[[wp:mainspace|main]]&amp;#039; },&lt;br /&gt;
	help = { 12, &amp;#039;[[wp:help namespace|help]]&amp;#039; },&lt;br /&gt;
	portal = { 100, &amp;#039;[[wp:portal|portal]]&amp;#039; },&lt;br /&gt;
	talk = { function(n) return n &amp;gt; 0 and n%2 == 1 end, &amp;#039;[[Help:Using talk pages|talk]]&amp;#039; },&lt;br /&gt;
	template = { 10, &amp;#039;[[wp:template namespace|template]]&amp;#039; },&lt;br /&gt;
	wikipedia = { 4, &amp;#039;[[wp:project namespace|Wikipedia project]]&amp;#039; },&lt;br /&gt;
	category = { 14, &amp;#039;[[wp:categorization|category]]&amp;#039; },&lt;br /&gt;
	user = { 2, &amp;#039;[[wp:user pages|user]]&amp;#039; },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-- remove whitespaces from beginning and end of args&lt;br /&gt;
local function valueFunc(key, val)&lt;br /&gt;
	if type(val) == &amp;#039;string&amp;#039; then&lt;br /&gt;
		val = val:match(&amp;#039;^%s*(.-)%s*$&amp;#039;)&lt;br /&gt;
		if val == &amp;#039;&amp;#039; then&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return val&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getPrettyName(args)&lt;br /&gt;
	for k in pairs(namespaceCategories) do&lt;br /&gt;
		if args[k .. &amp;#039; category&amp;#039;] then&lt;br /&gt;
			return string.format(&amp;quot;&amp;#039;&amp;#039;&amp;#039;[[:Category:%s|%s]]&amp;#039;&amp;#039;&amp;#039;: &amp;quot;, args[k .. &amp;#039; category&amp;#039;], args.name)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return string.format(&amp;quot;&amp;#039;&amp;#039;&amp;#039;%s&amp;#039;&amp;#039;&amp;#039;: &amp;quot;, args.name)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = require(&amp;#039;Module:Arguments&amp;#039;).getArgs(frame, {wrappers = &amp;#039;Template:Redirect template&amp;#039;, valueFunc = valueFunc})&lt;br /&gt;
	local namespace = mw.title.getCurrentTitle().namespace&lt;br /&gt;
&lt;br /&gt;
	--- XXX: this is a HORRIBLE HACK. kill it with fire as soon as https://bugzilla.wikimedia.org/show_bug.cgi?id=12974 is fixed&lt;br /&gt;
	local beCompatibleWithBug12974 = args.info and (args.info:find(&amp;#039;^[:;#*]&amp;#039;, 1) == 1 or args.info:find(&amp;#039;{|&amp;#039;, 1, true) == 1) and &amp;#039;\n&amp;#039; or &amp;#039; &amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	local content = string.format(&amp;#039;\n&amp;lt;div class=&amp;quot;rcat %s&amp;quot;&amp;gt;\n*%sThis is a redirect%s%s.%s%s\n&amp;lt;/div&amp;gt;&amp;#039;,&lt;br /&gt;
		args.class or &amp;#039;&amp;#039;,&lt;br /&gt;
		args.name and getPrettyName(args) or &amp;#039;&amp;#039;,&lt;br /&gt;
		args.from and (&amp;#039; from &amp;#039; .. args.from) or &amp;#039;&amp;#039;,&lt;br /&gt;
		args.to and (&amp;#039; to &amp;#039; .. args.to) or &amp;#039;&amp;#039;,&lt;br /&gt;
		args.info and beCompatibleWithBug12974 or &amp;#039;&amp;#039;,&lt;br /&gt;
		args.info or &amp;#039;&amp;#039;&lt;br /&gt;
	)&lt;br /&gt;
	&lt;br /&gt;
	for k,v in pairs(namespaceCategories) do&lt;br /&gt;
		if args[k .. &amp;#039; category&amp;#039;] then&lt;br /&gt;
			if type(v[1]) == &amp;#039;function&amp;#039; and v[1](namespace) or v[1] == namespace then&lt;br /&gt;
				content = content .. string.format(&amp;#039;[[Category:%s]]&amp;#039;, args[k .. &amp;#039; category&amp;#039;])&lt;br /&gt;
			elseif args[&amp;#039;other category&amp;#039;] then&lt;br /&gt;
				content = content .. string.format(&amp;#039;[[Category:%s]]&amp;#039;, args[&amp;#039;other category&amp;#039;])&lt;br /&gt;
			else&lt;br /&gt;
				content = content .. frame:expandTemplate{title = &amp;#039;Incorrect redirect template&amp;#039;, args = {v[2]}}&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if namespace == 0 then&lt;br /&gt;
		local yesno = require(&amp;#039;Module:Yesno&amp;#039;)&lt;br /&gt;
		if yesno(args.printworthy) == true then&lt;br /&gt;
			return content .. &amp;#039;[[Category:Printworthy redirects]]&amp;#039;&lt;br /&gt;
		elseif yesno(args.printworthy) == false then&lt;br /&gt;
			return content .. &amp;#039;[[Category:Unprintworthy redirects]]&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return content&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Caleb Cooper</name></author>
	</entry>
</feed>