Template:Braces/doc

From TechInfoDepot
Jump to navigationJump to search
  • The template returns the first unnamed parameter in double braces. To be used to demonstrate template code without the need for clunky nowiki'ing. Further unnamed parameters (up to 8 more) can be used without worrying for pipes.
  • An alternative is to use {{foo}}.
  • If the parameter tt (short for 'teletype', an early mono-spaced font) is set equal to any value apart from the null string, the font becomes a mono-spaced type which may be useful when displaying syntax format.
[Note – This may well be changed to the specific setting, "tt= y" to reduce potential clashes if a template uses the named parameter tt for something else. This setting should therefore be used to ensure compatibility with future changes.]
  • To improve legibility a 'thin-space' is inserted on each side of the pipe character '|' when displayed in transclusion.
  • If detailing a template which requires 'named-variable = ....', use {{=}} for the equals sign
Examples
{{braces|template-name|value1|value2}} gives {{template-name | value1 | value2}}
{{braces|tt=y|template-name|value1|value2}} gives {{template-name | value1 | value2}}
{{braces|tt=y|template-name|value1{{=}}XYZ|value2{{=}}PQR}} gives {{template-name | value1=XYZ | value2=PQR}}

BUT

{{braces|tt=y|template-name|value1=XYZ|value2=PQR}} gives {{template-name}}

See also