Template:Param/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Restore revision 230179 by Deprecated (talk): see revision 301898 of Template:Param)
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{Doc/subpage}}
{{Wikipedia port|documentation=1}}
<!-- Categories go at the bottom of this page. -->


This template is for giving examples of template parameter source code which is useful in template documentation and talk page discussions of template code.
This template is for giving examples of template parameter source code which is useful in template documentation and talk page discussions of template code.


===Usage===
== Parameters and Examples ==
:<code><nowiki>{{param|foo}}</nowiki></code> → {{param|foo}}
{| class=standard-table | style="width:100%"
:<code><nowiki>{{param|foo|tag=kbd}}</nowiki></code> &rarr; {{param|foo|tag=kbd}}
|-
:<code><nowiki>{{param|foo|bar}}</nowiki></code> → {{param|foo|bar}}
! Parameters
:<code><nowiki>{{param|foo|{{param|bar|nested=yes}}}}</nowiki></code> → {{param|foo|{{param|bar|nested=yes}}}}
! {{int:listfiles_description}}
:<code><nowiki>{{param|foo|{{param|bar|{{param|baz|derp|nested=yes}}|nested=yes}}}}</nowiki></code> → {{param|foo|{{param|bar|{{param|baz|derp|nested=yes}}|nested=yes}}}}
! {{int:apisandbox-examples}}
! {{int:preview}}
|-
| align=center | {{Code|{{Param}}}}
| Parameter name. Displays the number 1 by default, and also if the parameter is empty.<br>
The parameter name is highlighted in white, and also uses the CSS property {{Code|preset=1|user-select: all}}, to quickly copy the parameter name.
| {{CodeBlock|&#123;&#123;Param&#125;&#125;}} {{CodeBlock|&#123;&#123;Param&#124;&#125;&#125;}} {{CodeBlock|&#123;&#123;Param&#124;{{tint|color=comment|type}}&#125;&#125;}}
| {{Capsule|{{Param}}}} {{Capsule|{{Param|}}}} {{Capsule|{{Param|type}}}}
|-
| align=center | {{Code|{{Param|2}}}}
| The text to be inserted after the parameter name and the pipe symbol ({{Code|preset=1|&#124;}}). Leave blank to display only the pipe symbol.
| {{CodeBlock|&#123;&#123;Param&#124;&#124;&#125;&#125;}} {{CodeBlock|&#123;&#123;Param&#124;{{tint|color=comment|color}}&#124;&#125;&#125;}} {{CodeBlock|&#123;&#123;Param&#124;{{tint|color=comment|color}}&#124;{{tint|color=comment|initial}}&#125;&#125;}}
| {{Capsule|{{Param||}}}} {{Capsule|{{Param|color|}}}} {{Capsule|{{Param|color|initial}}}}
|-
|}


<includeonly>
== Other Examples ==
<!-- Categories below this line, please: -->
* {{Code|<nowiki>{{Param||}}</nowiki>}} → {{Param||}}
[[Category:Semantic markup templates]]
* {{Code|<nowiki>{{Param|2=}}</nowiki>}} → {{Param|2=}}
[[Category:Typing-aid templates]]
 
</includeonly>
 
* {{Code|<nowiki>{{Param||text}}</nowiki>}} → {{Param||text}}
* {{Code|<nowiki>{{Param|2=text}}</nowiki>}} → {{Param|2=text}}
 
 
*{{Code|<nowiki>{{Param|foo}}</nowiki>}} → {{Param|foo}}
*{{Code|<nowiki>{{Param|foo|bar}}</nowiki>}} → {{Param|foo|bar}}
*{{Code|<nowiki>{{Param|foo|{{Param|bar}}}}</nowiki>}} → {{Param|foo|{{Param|bar}}}}
*{{Code|<nowiki>{{Param|foo|{{Param|bar|{{Param|baz|derp}}}}}}</nowiki>}} → {{Param|foo|{{Param|bar|{{Param|baz|derp}}}}}}

Latest revision as of 09:37, 18 June 2024

Edit-copy.png
This is a documentation subpage for Template:Param.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

This template is for giving examples of template parameter source code which is useful in template documentation and talk page discussions of template code.

Parameters and Examples

Parameters Description Examples Preview
{{{1}}} Parameter name. Displays the number 1 by default, and also if the parameter is empty.

The parameter name is highlighted in white, and also uses the CSS property user-select: all, to quickly copy the parameter name.

{{Param}}
{{Param|}}
{{Param|type}}
{{{1}}}
{{{1}}}
{{{type}}}
{{{2}}} The text to be inserted after the parameter name and the pipe symbol (|). Leave blank to display only the pipe symbol.
{{Param||}}
{{Param|color|}}
{{Param|color|initial}}
{{{1|}}}
{{{color|}}}
{{{color|initial}}}

Other Examples

  • {{Param||}}{{{1|}}}
  • {{Param|2=}}{{{1|}}}


  • {{Param||text}}{{{1|text}}}
  • {{Param|2=text}}{{{1|text}}}


  • {{Param|foo}}{{{foo}}}
  • {{Param|foo|bar}}{{{foo|bar}}}
  • {{Param|foo|{{Param|bar}}}}{{{foo|{{{bar}}}}}}
  • {{Param|foo|{{Param|bar|{{Param|baz|derp}}}}}}{{{foo|{{{bar|{{{baz|derp}}}}}}}}}