Munurin millum rættingarnar hjá "Module:Template invocation/doc"

s
Bot: Erstatt forældet <source> -tag og parameteren "enclose" [https://lists.wikimedia.org/pipermail/wikitech-ambassadors/2020-April/002284.html]
(Stovnaði síðu við "This is a meta-module for producing MediaWiki template invocations. == Usage == First load the module: <source lang="lua"> local mTemplateInvocation = require('Module:T...")
 
s (Bot: Erstatt forældet <source> -tag og parameteren "enclose" [https://lists.wikimedia.org/pipermail/wikitech-ambassadors/2020-April/002284.html])
 
First load the module:
 
<sourcesyntaxhighlight lang="lua">
local mTemplateInvocation = require('Module:Template invocation')
</syntaxhighlight>
</source>
 
Then you can use the individual functions as documented below.
=== Name ===
 
<sourcesyntaxhighlight lang="lua">
mTemplateInvocation.name(title)
</syntaxhighlight>
</source>
 
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 ":", and for other pages it returns the full page name. <var>title</var> can be a string or a [[mw:Extension:Scribunto/Lua reference manual#Title objects|mw.title object]]. {{red|If <var>title</var> is a string, a mw.title object is created for it, which is [[WP:EXPENSIVE|expensive]].}}
=== Invocation ===
 
<sourcesyntaxhighlight lang="lua">
mTemplateInvocation.invocation(name, args, format)
</syntaxhighlight>
</source>
 
This function creates a MediaWiki [[Help:Template|template]] invocation.
14.816

rættingar