Template:Para

From MozillaWiki
Jump to: navigation, search

|

Documentation icon Template documentation[view] [edit] [history] [purge]

Usage

{{para}} is designed for giving examples of template parameter code, e.g. for use in template documentation or instructional texts.

Parameters

There are 5 parameters, of which 2 are unnamed and 3 are named. All five parameters are optional.

Syntax

The template's syntax is

  • {{para|parameter |value |serif=yes |equal=yes |plain=yes }}

By default, the three toggle parameters, |serif, |equal and |plain, are not used. They can only be invoked by explicitly setting them to the value yes. Any other value will keep them switched off.

Optional parameters

1

Parameter name

The parameter you want to describe.

Notes
  • This parameter can be used in three ways:
    1. with text: shows the entered text as the parameter name;
    2. empty: (by entering two vertical lines; NB! This is not the same as simply skipping the parameter; see the examples) shows the value, if entered, as if for an unnamed parameter; or
    3. with &124;: gives the illusion of empty parameter input (see the examples), will show any entered text as a parameter name. Can be used with either of the two ways described above.
  • Can be wiki-formatted.
  • Must be placed before the 2nd unnamed parameter.
Usage
  • {{para|1}}

2

Parameter value

A value for the parameter.

Notes
  • This parameter can be used in three ways:
    1. 1st parameter filled in: shows the parameter value after the parameter name, and following an equals sign;
    2. 1st parameter empty: (see above) shows the value without a preceding equals sign, as if for an unnamed parameter; or
    3. skipped: only the parameter name will be displayed (if entered).
  • Can be wiki-formatted, with one exception: italic output is preset, and cannot be changed.
  • Must be placed after the 1st unnamed parameter.
Usage
  • {{para|1|2}}

serif

Value output in serif font

You can override the default output styling for the parameter value parameter (|2), by using this parameter. The output will style the output using {{varserif}}, instead of the default meta-template, {{var}}.

By default, this parameter isn't used. It can only be invoked by explicitly setting it to the value yes. Any other value will keep it switched off.

Notes
  • This parameter only affects the look of parameter 2 (the parameter value).
Usage
  • {{para|1|2|serif=yes}}

equal

Insert equals sign

Inserts an equals sign after the parameter name when no value has been specified.

By default, this parameter isn't used. It can only be invoked by explicitly setting it to the value yes. Any other value will keep it switched off.

Notes
  • This parameter only works when the parameter name (1) is entered without being followed by a parameter value (i.e. not entering anything for the parameter value parameter, |2).
  • If the parameter value parameter (2) is defined, it will have precedence over |equal.
Usage
  • {{para|1|equal=yes}}

plain

Plain text styling

You can override the default output styling, by using this parameter. The output will inherit the CSS value for background-color and set border to none.

By default, this parameter isn't used. It can only be invoked by explicitly setting it to the value yes. Any other value will keep it switched off.

Usage
  • {{para|1|2|plain=yes}}

Examples

Case What you type What you see
No parameters {{para}}
Basic use parameter|value}} parameter=value
Only parameter parameter}} parameter
Only value {{para value}} value
serif parameter|value|serif=yes}} parameter=value
equal parameter|equal=yes}} parameter=
plain parameter|value|plain=yes}} parameter=value
serif and |plain parameter|value|serif=yes|plain=yes}} parameter=value
Using | {{para||parameter|value}} parameter=value
{{para||parameter}} parameter
{{para|||value}} |value
{{para||}}
Wiki-formatting You ''can'' '''use'''|{{sup|wiki}} <big>markup</big>}} You can use=wiki markup

See also

  • {{code}}: inserts HTML <code> tags.
  • {{samp}}: inserts HTML <samp> tags.
  • {{var}}: inserts HTML <var> tags; {{var}} is used in {{para}} to display the parameter value.
  • {{varserif}}: inserts HTML <var> tags with serif font styling.