Template:Xpdoc/doc: Difference between revisions
More actions
mNo edit summary |
No edit summary |
||
| (14 intermediate revisions by 4 users not shown) | |||
| Line 7: | Line 7: | ||
|2d=the parameter after the first pipe | |2d=the parameter after the first pipe | ||
|2def= | |2def= | ||
|2stat=optional | |2stat=optional- | ||
|3=gives | |3=3 | ||
| | |3d=the parameter after the second pipe | ||
| | |3def= | ||
| | |3stat=optional- | ||
|name= | |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</code><br> . . . .<br><code>n6 | |||
|7d=name of the first named parameter<br>...<br>name of the sixth named parameter | |||
|7stat=optional- | |||
|8=v1</code><br> . . . .<br><code>v6 | |||
|8d=value of the first named parameter<br>...<br>value of the sixth named parameter | |||
|8stat=optional- | |||
|9=gives | |||
|9d=text (or the empty string) to replace the arrow, e.g. gives=<nowiki>{{!}}{{!}}</nowiki> to produce "<nowiki>||</nowiki>", for use in a table | |||
|9def=→ | |||
|9stat=optional- | |||
|name=xpdoc | |||
|desc={{Documentation subpage}} | |desc={{Documentation subpage}} | ||
The expansion demo templates show, for documentation: | The expansion demo templates show, for documentation: | ||
| Line 21: | Line 45: | ||
|usergroup=all | |usergroup=all | ||
|placement= | |placement= | ||
|usage-notes= | |usage-notes= | ||
|type= | |type= | ||
|example= | |example=cc-by-4.0 | ||
|i18n-method= | |i18n-method=- | ||
|i18n-desc= | |i18n-desc= | ||
|seealso= | |seealso= | ||
|setscats= | |setscats= | ||
|lines= | |lines= | ||
| Line 33: | Line 57: | ||
}} | }} | ||
Naming scheme: | ==Notes== | ||
{{sed|1}}Naming scheme: | |||
*o = double opening braces | *o = double opening braces | ||
*c = double closing braces | *c = double closing braces | ||
This | This template combines the functionality of templates listed in the Expansion demo templates on Commons 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== | ||
<code><nowiki>{{ | {{sed|2}}<code><nowiki>{{xpdoc|ISOdate|2009-04-03}}</nowiki></code> produces: "{{xpdoc|ISOdate|2009-04-03}}". | ||
<includeonly>[[Category: | ==See also== | ||
{{sed|3}} | |||
*[[m:Help:Expansion demo templates]] | |||
{{Tle|T=Tle}} Meta template to describe template parametrizings | |||
<includeonly>[[Category:Template namespace templates]]</includeonly> | |||
Latest revision as of 16:33, 10 August 2026
The expansion demo templates show, for documentation:
- some wikitext
- its rendering
without the need of repeating the parameters in the wikitext.
Usage
{{xpdoc |1= }}
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. . . . n6 | name of the first named parameter ... name of the sixth named parameter | empty | optional | |
v1. . . . v6 | value of the first named parameter ... value of the sixth named parameter | empty | optional | |
gives | text (or the empty string) to replace the arrow, e.g. gives={{!}}{{!}} to produce "||", for use in a table | → | 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|cc-by-4.0}}
renders as:
{{cc-by-4.0}} → - You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
Localization
This template is not intended to be localized.
Notes
Naming scheme:
- o = double opening braces
- c = double closing braces
This template combines the functionality of templates listed in the Expansion demo templates on Commons 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".
See also
{{ Tle }} Meta template to describe template parametrizings