Template:Xpdoc/doc: Difference between revisions
More actions
mNo edit summary |
update |
||
| Line 8: | Line 8: | ||
|2def= | |2def= | ||
|2stat=optional | |2stat=optional | ||
|3= | |3=3 | ||
|3d= | |3d=the parameter after the second pipe | ||
|3def= | |3def= | ||
|3stat=optional | |3stat=optional | ||
|4=4 | |||
|4d=the parameter after the third pipe | |||
|4def= | |||
|4stat=optional | |||
|5=5 | |||
|5d=the parameter after the fourth pipe | |||
|5def= | |||
|5stat=optional | |||
|6=6 | |||
|6d=the parameter after the fifth pipe | |||
|6def= | |||
|6stat=optional | |||
|7=n1 | |||
|7d=name of the first named parameter | |||
|7def= | |||
|7stat=optional | |||
|8=v1 | |||
|8d=value of the first named parameter | |||
|8def= | |||
|8stat=optional | |||
|9=n2 | |||
|9d=name of the second named parameter | |||
|9def= | |||
|9stat=optional | |||
|10=v2 | |||
|10d=value of the second named parameter | |||
|10def= | |||
|10stat=optional | |||
|11=n3 | |||
|11d=name of the third named parameter | |||
|11def= | |||
|11stat=optional | |||
|12=v3 | |||
|12d=value of the third named parameter | |||
|12def= | |||
|12stat=optional | |||
|13=gives | |||
|13d=text (or the empty string) to replace the arrow, e.g. gives=<nowiki>{{!}}{{!}}</nowiki> to produce "<nowiki>||</nowiki>", for use in a table | |||
|13def=gives | |||
|13stat=optional | |||
|name=xpdoc | |name=xpdoc | ||
|desc={{Documentation subpage}} | |desc={{Documentation subpage}} | ||
Revision as of 10:38, 20 September 2010
The expansion demo templates show, for documentation:
- some wikitext
- its rendering
without the need of repeating the parameters in the wikitext.
Usage
{{xpdoc |1= |2= |3= |4= |5= |6= |n1= |v1= |n2= |v2= |n3= |v3= |gives= }}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | name of parser function, a colon, and the first parameter, or name of template | empty | required | |
2 | the parameter after the first pipe | empty | optional | |
3 | the parameter after the second pipe | empty | optional | |
4 | the parameter after the third pipe | empty | optional | |
5 | the parameter after the fourth pipe | empty | optional | |
6 | the parameter after the fifth pipe | empty | optional | |
n1 | name of the first named parameter | empty | optional | |
v1 | value of the first named parameter | empty | optional | |
n2 | name of the second named parameter | empty | optional | |
v2 | value of the second named parameter | empty | optional | |
n3 | name of the third named parameter | empty | optional | |
v3 | value of the third named parameter | empty | optional | |
gives | text (or the empty string) to replace the arrow, e.g. gives={{!}}{{!}} to produce "||", for use in a table | gives | optional | |
Additional information
The template is intended to be used in the following namespaces: the Template namespace
The template is intended to be used by the following user groups: all users
Example
{{xpdoc|Creator:Vincent van Gogh}}
renders as:
{{Creator:Vincent van Gogh}} → Template:Creator:Vincent van Gogh
Notes
Naming scheme:
- o = double opening braces
- c = double closing braces
This template combines the functionality of templates listed in m:Help:Expansion demo templates with a single o and c (no nesting), but with some restrictions.
In the case of demonstrating a template, values of unnamed parameters of this template are trimmed, so Template:Xpdoc cannot be used for demonstrating the effect of spaces at the start or end of an unnamed parameter.
Examples
{{xpdoc|ISOdate|2009-04-03}} produces: "{{ISOdate|2009-04-03}} → 3 April 2009".