Jump to content

Module:Template invocation/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mr. Stradivarius (talk | contribs) at 03:33, 24 November 2014 (start the documentation). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

This is a meta-module for producing MediaWiki template invocations.

Usage

First load the module:

local mTemplateInvocation = require('Module:Template invocation')

Then you can use the individual functions as documented below.

Name

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. If title is a string, a mw.title object is created for it, which is expensive.