Template:Code/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 20: Line 20:
| {{param|select}}
| {{param|select}}
| Sets the values for the user-select parameter.<br><br>'''Values:'''  
| Sets the values for the user-select parameter.<br><br>'''Values:'''  
*'''{{Code|1}}''': All (one click selection);  
*'''{{code|1}}''': All (one click selection);  
*'''{{Code|2}}''': None (template content will not be highlighted).
*'''{{code|2}}''': None (template content will not be highlighted).
|-
|-
| {{param|color}}
| {{param|color}}
Line 35: Line 35:




{{code|<nowiki>{{code|desaturated|Go to [[Main Page|Main Page]]}}</nowiki>}} {{code|<nowiki>{{code|desaturated|Go to {{hla|4}}}}</nowiki>}}
{{code|<nowiki>{{code|style=2|Go to [[Main Page|Main Page]]}}</nowiki>}} {{code|<nowiki>{{code|style=2|Go to {{hla|4}}}}</nowiki>}}
{{Doc/PreviewBlock|{{code|desaturated|Go to [[Main Page|Main Page]]}} {{code|desaturated|Go to {{hla|4}}}}}}
{{Doc/PreviewBlock|{{code|style=2|Go to [[Main Page|Main Page]]}} {{code|style=2|Go to {{hla|4}}}}}}




{{code|<nowiki>{{code|outlined|Go to [[Main Page|Main Page]]}}</nowiki>}} {{code|<nowiki>{{code|outlined|Go to {{hla|4}}}}</nowiki>}}
{{code|<nowiki>{{code|style=1|Go to [[Main Page|Main Page]]}}</nowiki>}} {{code|<nowiki>{{code|style=2|Go to {{hla|4}}}}</nowiki>}}
{{Doc/PreviewBlock|{{code|outlined|Go to [[Main Page|Main Page]]}} {{code|outlined|Go to {{hla|4}}}}}}
{{Doc/PreviewBlock|{{code|style=1|Go to [[Main Page|Main Page]]}} {{code|style=2|Go to {{hla|4}}}}}}




{{code|<nowiki>{{code|select=1|background=rgb(230,230,230)|color=black|Go to '''[[Main Page|Main Page]]'''}}</nowiki>}} {{code|<nowiki>{{code|background=rgb(40,60,100)|Go to {{hla|4}}}}</nowiki>}}
{{code|<nowiki>{{code|select=1|bg=rgb(230,230,230)|color=black|Go to '''[[Main Page|Main Page]]'''}}</nowiki>}} {{code|<nowiki>{{code|bg=rgb(40,60,100)|Go to {{hla|4}}}}</nowiki>}}
{{Doc/PreviewBlock|{{code|select=1|background=rgb(230,230,230)|color=black|Go to '''[[Main Page|Main Page]]'''}} {{code|background=rgb(40,60,100)|Go to {{hla|4}}}}}}
{{Doc/PreviewBlock|{{code|select=1|bg=rgb(230,230,230)|color=black|Go to '''[[Main Page|Main Page]]'''}} {{code|bg=rgb(40,60,100)|Go to {{hla|4}}}}}}
 
== Deprecated Parameters ==
These parameters will be removed in the future, but are currently required for pages that still use them to function correctly.
 
{| class="standard-table"
! colspan="2" | Styles
|-
| {{param|oneclick}}
| one-click selection
|-
| {{param|desaturated-oneclick}}
| less saturated version with one-click selection
|-
| {{param|outline}}
| less saturated version with outline&nbsp;
|-
| {{param|outline-oneclick}}
| less saturated version with outline and one-click selection
|}


<includeonly>{{sandbox other||
<includeonly>{{sandbox other||
[[Category:Markdown]]
[[Category:Markdown]]
}}</includeonly>
}}</includeonly>

Revision as of 13:39, 23 January 2023

English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Edit-copy.png
This is a documentation subpage for Template:Code.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

This template will allow you to format text as a one-line code. The default style is based on Markdown.

Parameters

Styles
{{{desaturated}}} less saturated version
{{{outlined}}} less saturated version with outline 
{{{clear}}} no style
Modifiers
{{{select}}} Sets the values for the user-select parameter.

Values:
  • 1: All (one click selection);
  • 2: None (template content will not be highlighted).
{{{color}}} allows you to change the color of the text if the default style is enabled
{{{background}}} allows you to change the background color if the default style is enabled 

Examples

{{code|Go to [[Main Page|Main Page]]}} {{code|Go to {{hla|4}}}}

Go to Main Page Go to Half-Life: Alyx Half-Life: Alyx


{{code|style=2|Go to [[Main Page|Main Page]]}} {{code|style=2|Go to {{hla|4}}}}

Go to Main Page Go to Half-Life: Alyx Half-Life: Alyx


{{code|style=1|Go to [[Main Page|Main Page]]}} {{code|style=2|Go to {{hla|4}}}}

Go to Main Page Go to Half-Life: Alyx Half-Life: Alyx


{{code|select=1|bg=rgb(230,230,230)|color=black|Go to '''[[Main Page|Main Page]]'''}} {{code|bg=rgb(40,60,100)|Go to {{hla|4}}}}

Go to Main Page Go to Half-Life: Alyx Half-Life: Alyx