Difference between revisions of "Template:Braces/doc"

From blackwiki
Jump to navigation Jump to search
imported>Meteor sandwich yum
(-Regbraces, which will be deleted)
imported>Sardanaphalus
(categories from template page)
Line 1: Line 1:
 
{{documentation subpage}}
 
{{documentation subpage}}
 +
 
* 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.
 
* 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 <tt>&amp;#123;{foo}&amp;#125;</tt>.
 
* An alternative is to use <tt>&amp;#123;{foo}&amp;#125;</tt>.
Line 18: Line 19:
 
* {{tl|Mono}} monospaced font
 
* {{tl|Mono}} monospaced font
 
* {{tl|Ttt}} {{tag|tt}} tags
 
* {{tl|Ttt}} {{tag|tt}} tags
 +
 +
<includeonly>
 +
[[Category:Wikipedia formatting and function templates]]
 +
[[Category:Typing-aid templates]]
 +
</includeonly>

Revision as of 12:12, 8 February 2014

  • 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 &#123;{foo}&#125;.
  • 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