<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.fallenchungus.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ARedirect%2Fdoc</id>
	<title>Module:Redirect/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.fallenchungus.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ARedirect%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://www.fallenchungus.wiki/index.php?title=Module:Redirect/doc&amp;action=history"/>
	<updated>2026-04-19T21:54:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.3</generator>
	<entry>
		<id>https://www.fallenchungus.wiki/index.php?title=Module:Redirect/doc&amp;diff=2294&amp;oldid=prev</id>
		<title>CapybaraKiller: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://www.fallenchungus.wiki/index.php?title=Module:Redirect/doc&amp;diff=2294&amp;oldid=prev"/>
		<updated>2025-05-25T18:16:41Z</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 11:16, 25 May 2025&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>CapybaraKiller</name></author>
	</entry>
	<entry>
		<id>https://www.fallenchungus.wiki/index.php?title=Module:Redirect/doc&amp;diff=2293&amp;oldid=prev</id>
		<title>wikipedia&gt;Annh07: Reverted edit by 2804:7F0:D81A:2736:30B5:1374:88FD:8FE6 (talk) to last version by Discospinster</title>
		<link rel="alternate" type="text/html" href="https://www.fallenchungus.wiki/index.php?title=Module:Redirect/doc&amp;diff=2293&amp;oldid=prev"/>
		<updated>2025-02-19T19:10:42Z</updated>

		<summary type="html">&lt;p&gt;Reverted edit by &lt;a href=&quot;/Special:Contributions/2804:7F0:D81A:2736:30B5:1374:88FD:8FE6&quot; title=&quot;Special:Contributions/2804:7F0:D81A:2736:30B5:1374:88FD:8FE6&quot;&gt;2804:7F0:D81A:2736:30B5:1374:88FD:8FE6&lt;/a&gt; (&lt;a href=&quot;/index.php?title=User_talk:2804:7F0:D81A:2736:30B5:1374:88FD:8FE6&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:2804:7F0:D81A:2736:30B5:1374:88FD:8FE6 (page does not exist)&quot;&gt;talk&lt;/a&gt;) to last version by Discospinster&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{used in system}}&lt;br /&gt;
{{Module rating|beta}}&lt;br /&gt;
{{Module rating|protected}}&lt;br /&gt;
{{Lua|Module:Arguments}}&lt;br /&gt;
This module contains functions to find the target of a [[Help:Redirect|redirect]] page.&lt;br /&gt;
&lt;br /&gt;
== Main ==&lt;br /&gt;
&lt;br /&gt;
The main function accepts the name of a single page.  It determines if the page is a redirect; if so it looks up the page, extracts the target, and returns the target name as text. Its usage is &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:redirect|main|page-name}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;page-name&amp;lt;/code&amp;gt; does not exist or is not a redirect then &amp;lt;code&amp;gt;page-name&amp;lt;/code&amp;gt; is returned. If &amp;lt;code&amp;gt;page-name&amp;lt;/code&amp;gt; is blank then blank is returned.&lt;br /&gt;
&lt;br /&gt;
The function normally neither takes nor gives square brackets, so to show the result as a link use &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[{{#invoke:redirect|main|page-name}}]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
If the parameter &amp;#039;&amp;#039;bracket&amp;#039;&amp;#039; is given a nonblank value, brackets will be passed on if present.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:redirect|main|WP:AFC}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; {{#invoke:redirect|main|WP:AFC}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:redirect|main|[[WP:AFD]]|bracket=yes}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; {{#invoke:redirect|main|[[WP:AFD]]|bracket=yes}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:redirect|main|Wikipedia:Articles for deletion}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; {{#invoke:redirect|main|Wikipedia:Articles for deletion}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:redirect|main|Wikipedia:Articles for rumination}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; {{#invoke:redirect|main|Wikipedia:Articles for rumination}}&lt;br /&gt;
&lt;br /&gt;
Note: [[WP:AFC]] and [[WP:AFD]] are both redirects, but [[Wikipedia:Articles for deletion]] is not, and [[Wikipedia:Articles for rumination]] does not exist.&lt;br /&gt;
&lt;br /&gt;
=== LuaMain ===&lt;br /&gt;
&lt;br /&gt;
If you want to use the main function from another Lua module, you may want to use the luaMain function. This provides the same functionality as the main function, but doesn&amp;#039;t require that a frame object be available.&lt;br /&gt;
&lt;br /&gt;
To use this, first load the module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local mRedirect = require(&amp;#039;Module:Redirect&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then use the function with the following syntax: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
mRedirect.luaMain(rname, bracket)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;var&amp;gt;rname&amp;lt;/var&amp;gt; is the name of the redirect page, and if &amp;lt;var&amp;gt;bracket&amp;lt;/var&amp;gt; is anything but false or nil, the module will produce a link rather than just a page name.&lt;br /&gt;
&lt;br /&gt;
== IsRedirect ==&lt;br /&gt;
&lt;br /&gt;
The isRedirect function is used from wiki pages to find out if a given page is a redirect or not. If the page is a redirect, the function returns &amp;quot;yes&amp;quot;, and if not the output is blank. Its usage is &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:redirect|isRedirect|page-name}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:redirect|isRedirect|WP:AFC}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; {{#invoke:redirect|isRedirect|WP:AFC}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:redirect|isRedirect|Wikipedia:Articles for deletion}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; {{#invoke:redirect|isRedirect|Wikipedia:Articles for deletion}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:redirect|isRedirect|Wikipedia:Articles for rumination}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; {{#invoke:redirect|isRedirect|Wikipedia:Articles for rumination}}&lt;br /&gt;
&lt;br /&gt;
=== LuaIsRedirect ===&lt;br /&gt;
The isRedirect can be accessed from other Lua modules in the same way as the main function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local mRedirect = require(&amp;#039;Module:Redirect&amp;#039;)&lt;br /&gt;
mRedirect.luaIsRedirect(rname)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetTarget ==&lt;br /&gt;
&lt;br /&gt;
The getTarget function fetches the target page name of a redirect page, and is only usable from Lua. If the page specified is a redirect, then the target is returned; otherwise the function returns nil.&lt;br /&gt;
&lt;br /&gt;
To use it, first load the module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local mRedirect = require(&amp;#039;Module:Redirect&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then use the function with the following syntax: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
mRedirect.getTarget(page)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;var&amp;gt;page&amp;lt;/var&amp;gt; can be either the name of the redirect page as a string, or a [[mw:Extension:Scribunto/Lua reference manual#Title objects|mw.title object]].&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[phab:T68974]] -  Provide a standard way to get the target of a redirect page&lt;br /&gt;
* [[mw:Extension:Scribunto/Lua reference manual#Title objects]], the Scribunto interface for determining a page&amp;#039;s redirect status&lt;br /&gt;
* [[Template:Get QID]], which uses this module &lt;br /&gt;
* [[Template:Submit an edit request]], which uses this module&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;Annh07</name></author>
	</entry>
</feed>