45,333
edits
(Created page with "{{Documentation subpage}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> == Usage == This template is for giving examples of [[Wikipedia:Template me...") |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{ | {{documentation subpage}} | ||
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> | <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> | ||
== Usage == | |||
This template simply displays a parameter name between a vertical line and an equal sign, as is seen in [[wikt:Wiktionary:Templates|template]] calls. (This is useful in template documentation and in talk page discussions of templates.) | |||
== | ===Parameters=== | ||
This template | This template takes the following parameters: | ||
*{{para|1||''may be empty'' if second parameter is present}}: the name of the parameter | |||
*{{para|2||''optional'' if first parameter is present}}: a corresponding value for the parameter | |||
*{{para|3|opt=1}}: additional usage text | |||
*{{para|req|1}}: indicate that the parameter is required | |||
*{{para|opt|1}}: indicate that the parameter is optional | |||
===Examples=== | ===Examples=== | ||
# | # {{temp|para|name}} | ||
#: | #: Result: {{para|name}} | ||
#:{{para|name}} | # {{temp|para|name|req=1}} | ||
# | #: Result: {{para|name|req=1}} | ||
#: | # {{temp|para|name|opt=1}} | ||
#:{{para|title|<var>book title</var>}} | #: Result: {{para|name|opt=1}} | ||
# | # {{temp|para|opt|1}} | ||
# | #: Result: {{para|opt|1}} | ||
#:{{para||section}} | # {{temp|para|title|<nowiki><var>book title</var></nowiki>}} | ||
#: Result: {{para|title|<var>book title</var>}} | |||
# | # {{temp|para||section}} | ||
#: | #: Result: {{para||section}}. This is useful for referring to values of unnamed parameters; note the empty first parameter in the template call. | ||
# {{temp|para|<nowiki><var>parameter</var></nowiki>|<nowiki><var>value</var></nowiki>}} | |||
#: Result: {{para|<var>parameter</var>|<var>value</var>}} | |||
# {{temp|para|=|foo}} | |||
#: Result: {{para|=|foo}} | |||
# {{temp|para|2||<nowiki>''optional'' if first parameter is present</nowiki>}} | |||
#: Result: {{para|2||''optional'' if first parameter is present}} | |||
When using literal, pre-specified values, simply provide the value (appearance as in example 6). When illustrating hypothetical, variable or user-definable values, use <code><var>value</var></code> (appearance as in example 5), and the same should be done for non-literal, example parameters (as in example 7). | |||
== See also == | == See also == | ||
* [[Template: | * [[Template:tlx]] – for providing examples of entire-template code with included parameters | ||
<noinclude> | <noinclude>[[Category:Templates]][[Category:Template documentation]]</noinclude> | ||
[[Category:Templates]][[Category:Template documentation]]</noinclude> |