<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pttlink.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ATemplate_invocation%2Fdoc</id>
	<title>Module:Template invocation/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pttlink.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ATemplate_invocation%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://wiki.pttlink.org/index.php?title=Module:Template_invocation/doc&amp;action=history"/>
	<updated>2026-04-06T13:57:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.5</generator>
	<entry>
		<id>https://wiki.pttlink.org/index.php?title=Module:Template_invocation/doc&amp;diff=11911&amp;oldid=prev</id>
		<title>Kg7qin: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.pttlink.org/index.php?title=Module:Template_invocation/doc&amp;diff=11911&amp;oldid=prev"/>
		<updated>2022-01-24T15:14:24Z</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&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 15:14, 24 January 2022&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>Kg7qin</name></author>
	</entry>
	<entry>
		<id>https://wiki.pttlink.org/index.php?title=Module:Template_invocation/doc&amp;diff=11910&amp;oldid=prev</id>
		<title>Mediawiki&gt;WOSlinker: change source to syntaxhighlight</title>
		<link rel="alternate" type="text/html" href="https://wiki.pttlink.org/index.php?title=Module:Template_invocation/doc&amp;diff=11910&amp;oldid=prev"/>
		<updated>2020-07-07T13:28:18Z</updated>

		<summary type="html">&lt;p&gt;change source to syntaxhighlight&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is a meta-module for producing MediaWiki template invocations.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
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 mTemplateInvocation = require('Module:Template invocation')&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can use the individual functions as documented below.&lt;br /&gt;
&lt;br /&gt;
=== Name ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
mTemplateInvocation.name(title)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function produces the name to be used in a template invocation. For pages in the template namespace it returns the page name with no namespace prefix, for pages in the main namespace it returns the full page name prefixed with &amp;quot;:&amp;quot;, and for other pages it returns the full page name. &amp;lt;var&amp;gt;title&amp;lt;/var&amp;gt; can be a string or a [[mw:Extension:Scribunto/Lua reference manual#Title objects|mw.title object]].&lt;br /&gt;
&lt;br /&gt;
=== Invocation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
mTemplateInvocation.invocation(name, args, format)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function creates a MediaWiki [[Help:Template|template]] invocation.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* '''name''' - the name of the template (string, required). This should be exactly as it will appear in the invocation, e.g. for [[Template:Example]] use &amp;quot;Example&amp;quot;. To generate the template name from a page name you can use the [[#Name|name]] function.&lt;br /&gt;
* '''args''' - the arguments to use in the invocation (table, required). Table keys and values must be either strings or numbers.&lt;br /&gt;
* '''format''' - the format of the invocation (string, optional). The default is a normal invocation with unescaped curly braces, pipes, and equals signs. If this parameter is the string &amp;quot;nowiki&amp;quot;, then the curly braces, pipes and equals signs are replaced with the appropriate [[HTML entities]].&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&lt;br /&gt;
The code {{code|1=mTemplateInvocation.invocation('foo', {'bar', 'baz', abc = 'def'})|2=lua}} would produce &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{foo|bar|baz|abc=def}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox||&lt;br /&gt;
&amp;lt;!-- Categories go here and interwikis go in Wikidata. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mediawiki&gt;WOSlinker</name></author>
	</entry>
</feed>