<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.railos.org/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://wiki.railos.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ARedirect_template"/>
	<link rel="alternate" type="text/html" href="https://wiki.railos.org/index.php?title=Module:Redirect_template&amp;action=history"/>
	<updated>2026-04-05T22:44:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://wiki.railos.org/index.php?title=Module:Redirect_template&amp;diff=3700&amp;oldid=prev</id>
		<title>Krizar: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.railos.org/index.php?title=Module:Redirect_template&amp;diff=3700&amp;oldid=prev"/>
		<updated>2023-03-11T16:31:28Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&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 16:31, 11 March 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&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>Krizar</name></author>
	</entry>
	<entry>
		<id>https://wiki.railos.org/index.php?title=Module:Redirect_template&amp;diff=3699&amp;oldid=prev</id>
		<title>wiki&gt;WOSlinker: use require(&#039;strict&#039;) instead of require(&#039;Module:No globals&#039;)</title>
		<link rel="alternate" type="text/html" href="https://wiki.railos.org/index.php?title=Module:Redirect_template&amp;diff=3699&amp;oldid=prev"/>
		<updated>2022-10-21T08:08:03Z</updated>

		<summary type="html">&lt;p&gt;use require(&amp;#039;strict&amp;#039;) instead of require(&amp;#039;Module:No globals&amp;#039;)&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;
&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: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.id and (&amp;#039;rcat-&amp;#039; .. string.gsub(args.id, &amp;#039; &amp;#039;, &amp;#039;_&amp;#039;)) 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;
				if args.sortkey then&lt;br /&gt;
					content = content .. string.format(&amp;#039;[[Category:%s|%s]]&amp;#039;, args[k .. &amp;#039; category&amp;#039;], args.sortkey)&lt;br /&gt;
					else&lt;br /&gt;
						content = content .. string.format(&amp;#039;[[Category:%s]]&amp;#039;, args[k .. &amp;#039; category&amp;#039;])&lt;br /&gt;
				end&lt;br /&gt;
			elseif args[&amp;#039;other category&amp;#039;] then&lt;br /&gt;
				if args.sortkey then&lt;br /&gt;
					content = content .. string.format(&amp;#039;[[Category:%s|%s]]&amp;#039;, args[&amp;#039;other category&amp;#039;], args.sortkey)&lt;br /&gt;
					else&lt;br /&gt;
						content = content .. string.format(&amp;#039;[[Category:%s]]&amp;#039;, args[&amp;#039;other category&amp;#039;])&lt;br /&gt;
				end&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>wiki&gt;WOSlinker</name></author>
	</entry>
</feed>