wikipedia>Jdaloner
Modified <includeonly> section so that "sandbox" subpage won't appear in categories.
wikipedia>Sardanaphalus
Examples: Aligned table, replaced <tt>, slightr rephrasing
Line 7: Line 7:


===Examples===
===Examples===
#&nbsp;&nbsp;{{tlx|para|name}}
{{Aligned table
#:renders as
|col1style=padding-right:1.0em;
#:{{para|name}}
| '''Code''' | '''Result'''
#&nbsp;&nbsp;{{tlx|para|title|&lt;var&gt;book title&lt;/var&gt;}}
| {{tlx|para|name}} | {{para|name}}
#:renders as
| {{tlx|para|title|&lt;var&gt;book title&lt;/var&gt;}} | {{para|title|<var>book title</var>}}
#:{{para|title|<var>book title</var>}}
| {{tlx|para|2=<span style="font-size:1pt;">&nbsp;</span>|3=section}} | {{para||section}}{{pad}}{{95%|(for [[Help:Templates#Parameters|unnamed parameters]]; note empty first parameter)}}
#&nbsp;&nbsp;{{tlx|para|3=section|2=<span style="font-size: 1pt;">&nbsp;</span>}}
| {{tlx|para|&lt;var&gt;parameter&lt;/var&gt;|&lt;var&gt;value&lt;/var&gt;}} | {{para|<var>parameter</var>|<var>value</var>}}
#:renders as
}}
#:{{para||section}}
When using literal, pre-specified values, simply provide the value (as in the third example above). When illustrating hypothetical, variable or user-definable values, use {{plaincode|<nowiki><var>value</var></nowiki>}} (as in the second example above) and the same should be done for non-literal, example parameters (fourth example above).
#:(for unnamed parameters in the example code; note the empty first parameter in the {{tlx|para}} template)
#&nbsp;&nbsp;{{tlx|para|&lt;var&gt;parameter&lt;/var&gt;|&lt;var&gt;value&lt;/var&gt;}}
#:renders as
#:{{para|<var>parameter</var>|<var>value</var>}}
 
When using literal, pre-specified values, simply provide the value (appearance as in example 3). When illustrating hypothetical, variable or user-definable values, use <tt><nowiki><var>value</var></nowiki></tt> (appearance as in example 2), and the same should be done for non-literal, example parameters (as in example 4).


== See also ==
== See also ==

Revision as of 11:58, 19 September 2014

Template:Documentation subpage Template:Distinguish

Usage

This template is for giving examples of template parameter source code (useful in template documentation and talk page discussions of template code). It must have one or two parameters itself. The first is the name of the example parameter to display (this may be empty, but it must be present), and the second (optional) one is a value for the first example parameter, or (if the first {{para}} parameter is empty) an unnamed example parameter.

Examples

Template:Aligned table When using literal, pre-specified values, simply provide the value (as in the third example above). When illustrating hypothetical, variable or user-definable values, use Template:Plaincode (as in the second example above) and the same should be done for non-literal, example parameters (fourth example above).

See also

  • {{Param}}
  • {{Tlx}}, for providing examples of entire-template[?] code including parameters.

Template:Tl-nav