<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="nb">
	<id>https://www.wikisida.no/index.php?action=history&amp;feed=atom&amp;title=Modul%3ARedirect%2Fdok</id>
	<title>Modul:Redirect/dok - Sideversjonshistorikk</title>
	<link rel="self" type="application/atom+xml" href="https://www.wikisida.no/index.php?action=history&amp;feed=atom&amp;title=Modul%3ARedirect%2Fdok"/>
	<link rel="alternate" type="text/html" href="https://www.wikisida.no/index.php?title=Modul:Redirect/dok&amp;action=history"/>
	<updated>2026-04-15T19:23:21Z</updated>
	<subtitle>Versjonshistorikk for denne siden på wikien</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://www.wikisida.no/index.php?title=Modul:Redirect/dok&amp;diff=774&amp;oldid=prev</id>
		<title>Wikisida: Én sideversjon ble importert</title>
		<link rel="alternate" type="text/html" href="https://www.wikisida.no/index.php?title=Modul:Redirect/dok&amp;diff=774&amp;oldid=prev"/>
		<updated>2026-02-08T09:48:52Z</updated>

		<summary type="html">&lt;p&gt;Én sideversjon ble importert&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;nb&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Eldre sideversjon&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Sideversjonen fra 8. feb. 2026 kl. 09:48&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;nb&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(Ingen forskjell)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key c1wiki:diff:1.41:old-773:rev-774 --&gt;
&lt;/table&gt;</summary>
		<author><name>Wikisida</name></author>
	</entry>
	<entry>
		<id>https://www.wikisida.no/index.php?title=Modul:Redirect/dok&amp;diff=773&amp;oldid=prev</id>
		<title>nb&gt;Jeblad (bot): bytter tagger for tag-funksjon</title>
		<link rel="alternate" type="text/html" href="https://www.wikisida.no/index.php?title=Modul:Redirect/dok&amp;diff=773&amp;oldid=prev"/>
		<updated>2020-04-25T23:57:27Z</updated>

		<summary type="html">&lt;p&gt;bytter tagger for tag-funksjon&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Ny side&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&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|redirect-page-name}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The template normally neither takes nor gives square brackets, so to show the result as a link use &amp;lt;nowiki&amp;gt;[[{{#invoke:redirect|main|redirect-page-name}}]]&amp;lt;/nowiki&amp;gt;.  An error is produced if the redirect does not exist, but for versatility no error is given if the file is not a redirect (returns the original text) or if the file name is blank (returns blank).&lt;br /&gt;
&lt;br /&gt;
However, 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;
&lt;br /&gt;
Note: [[WP:AFC]] and [[WP:AFD]] are both redirects, but [[Wikipedia:Articles for deletion]] is not.&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|redirect-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;
&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;
&lt;br /&gt;
* [[Template:Submit an edit request]], which uses this module&lt;/div&gt;</summary>
		<author><name>nb&gt;Jeblad (bot)</name></author>
	</entry>
</feed>