This is a meta-module for producing MediaWiki template invocations.
This is a meta-module for producing MediaWiki template invocations.
| This Lua module is used on approximately 3,200 pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them. |
| This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing. |
First, load the module:
local mTemplateInvocation = require('Module:Template invocation')
Then you can use the individual functions as documented below.
mTemplateInvocation.name(title)
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. title can be a string or a mw.title object.
mTemplateInvocation.invocation(name, args, format)
This function creates a MediaWiki template invocation.
Parameters:
Example
The code mTemplateInvocation.invocation('foo', {'bar', 'baz', abc = 'def'}) would produce {{foo|bar|baz |abc=def}}.
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.