Difference between revisions of "Template:Braces/doc"

From blackwiki
Jump to navigation Jump to search
imported>Meteor sandwich yum
m (→‎See also: “released” my template (created a link outside my user space for first time). Gave descriptions of all ‘see also’ s)
imported>Meteor sandwich yum
(rem categories; moving to Template:Braces)
Line 19: 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|{{PAGENAME}}]]
 
[[Category:Typing-aid templates]]
 
</includeonly>
 

Revision as of 03:33, 23 January 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