Template:Code/doc: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 4: | Line 4: | ||
== Parameters and Examples == | == Parameters and Examples == | ||
{| class=standard-table | style="width:100% | {| class=standard-table | style="width:100%" | ||
|- | |- | ||
! Parameter | ! Parameter | ||
Line 11: | Line 11: | ||
! Preview | ! Preview | ||
|- | |- | ||
| align= | | align=center | {{Code|{{param|style}}}} | ||
| The style of the template. The following styles are available: | | The style of the template. The following styles are available: | ||
:* {{Code| | :* {{Code|style=3|Default}} – the default style is based on Markdown; | ||
:* {{Code|2}} | :* {{Code|1}} – Outlined version; | ||
:* {{Code|3}} | :* {{Code|2}} – Desaturated version; | ||
:* {{Code|4}} | :* {{Code|3}} – Clear version; | ||
:* {{Code|4}} – A brighter outlined version. | |||
| {{CodeBlock|{{Code|{{tint|color=yellow|style}}<nowiki>=</nowiki>{{tint|color=green|1}}|{{tint|color=comment|Hello, World!}}}}}} {{CodeBlock|{{Code|{{tint|color=yellow|style}}<nowiki>=</nowiki>{{tint|color=green|2}}|{{tint|color=comment|Hello, World!}}}}}} {{CodeBlock|{{Code|{{tint|color=yellow|style}}<nowiki>=</nowiki>{{tint|color=green|3}}|{{tint|color=comment|Hello, World!}}}}}}{{CodeBlock|{{Code|{{tint|color=yellow|style}}<nowiki>=</nowiki>{{tint|color=green|4}}|{{tint|color=comment|Hello, World!}}}}}} | | {{CodeBlock|{{Code|{{tint|color=yellow|style}}<nowiki>=</nowiki>{{tint|color=green|1}}|{{tint|color=comment|Hello, World!}}}}}} {{CodeBlock|{{Code|{{tint|color=yellow|style}}<nowiki>=</nowiki>{{tint|color=green|2}}|{{tint|color=comment|Hello, World!}}}}}} {{CodeBlock|{{Code|{{tint|color=yellow|style}}<nowiki>=</nowiki>{{tint|color=green|3}}|{{tint|color=comment|Hello, World!}}}}}}{{CodeBlock|{{Code|{{tint|color=yellow|style}}<nowiki>=</nowiki>{{tint|color=green|4}}|{{tint|color=comment|Hello, World!}}}}}} | ||
| {{Capsule|margin=5px|{{Code|style=1|Hello, World!}}}} {{Capsule|margin=5px|{{Code|style=2|Hello, World!}}}} {{Capsule|margin=5px|{{Code|style=3|Hello, World!}}}} {{Capsule|margin=5px|{{Code|style=4|Hello, World!}}}} | | {{Capsule|margin=5px|{{Code|style=1|Hello, World!}}}} {{Capsule|margin=5px|{{Code|style=2|Hello, World!}}}} {{Capsule|margin=5px|{{Code|style=3|Hello, World!}}}} {{Capsule|margin=5px|{{Code|style=4|Hello, World!}}}} | ||
|- | |- | ||
| align= | | align=center | {{Code|{{param|select}}}} | ||
| Text selection mode. The following values are available: | | Text selection mode. The following values are available: | ||
: | :* {{Code|style=3|Default}} – Initial state; | ||
: | :* {{Code|0}} – None: template content will not be highlighted; | ||
:* {{Code|1}} – All: one click selection. | |||
| {{CodeBlock|{{Code|{{tint|color=yellow|select}}<nowiki>=</nowiki>{{tint|color=green|1}}|{{tint|color=comment|Hello, World!}}}}}} {{CodeBlock|{{Code|{{tint|color=yellow|select}}<nowiki>=</nowiki>{{tint|color=green|2}}|{{tint|color=comment|Hello, World!}}}}}} | | {{CodeBlock|{{Code|{{tint|color=yellow|select}}<nowiki>=</nowiki>{{tint|color=green|1}}|{{tint|color=comment|Hello, World!}}}}}} {{CodeBlock|{{Code|{{tint|color=yellow|select}}<nowiki>=</nowiki>{{tint|color=green|2}}|{{tint|color=comment|Hello, World!}}}}}} | ||
| {{Capsule|margin=5px|{{Code|select=1|Hello, World!}}}} {{Capsule|margin=5px|{{Code|select=2|Hello, World!}}}} | | {{Capsule|margin=5px|{{Code|select=1|Hello, World!}}}} {{Capsule|margin=5px|{{Code|select=2|Hello, World!}}}} | ||
|- | |- | ||
| align= | | align=center | {{Code|{{param|color}}}} | ||
| Text color. <br> HSL, HEX, RGB and more are supported. | | Text color. <br> HSL, HEX, RGB and more are supported. | ||
| {{CodeBlock|{{Code|{{tint|color=yellow|color}}<nowiki>=</nowiki>{{tint|color=green|#EF9B9B}}|{{tint|color=comment|Hello, World!}}}}}} | | {{CodeBlock|{{Code|{{tint|color=yellow|color}}<nowiki>=</nowiki>{{tint|color=green|#EF9B9B}}|{{tint|color=comment|Hello, World!}}}}}} | ||
| {{Capsule|margin=5px|{{Code|color=#EF9B9B|Hello, World!}}}} | | {{Capsule|margin=5px|{{Code|color=#EF9B9B|Hello, World!}}}} | ||
|- | |- | ||
| align= | | align=center | {{Code|{{param|bg}}}} | ||
| Background color. <br> HSL, HEX, RGB and more are supported. | | Background color. <br> HSL, HEX, RGB and more are supported. | ||
| {{CodeBlock|{{Code|{{tint|color=yellow|bg}}<nowiki>=</nowiki>{{tint|color=green|rgba(239,155,155,.15)}}|{{tint|color=comment|Hello, World!}}}}}} | | {{CodeBlock|{{Code|{{tint|color=yellow|bg}}<nowiki>=</nowiki>{{tint|color=green|rgba(239,155,155,.15)}}|{{tint|color=comment|Hello, World!}}}}}} | ||
| {{Capsule|margin=5px|{{Code|bg=rgba(239,155,155,.15)|Hello, World!}}}} | | {{Capsule|margin=5px|{{Code|bg=rgba(239,155,155,.15)|Hello, World!}}}} |
Revision as of 04:28, 29 April 2023

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.
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.
Parameters and Examples
Parameter | Description | Example | Preview |
---|---|---|---|
{{{style}}} | The style of the template. The following styles are available:
|
Hello, World! Hello, World! Hello, World! Hello, World!
| |
{{{select}}} | Text selection mode. The following values are available:
|
Hello, World! Hello, World!
| |
{{{color}}} | Text color. HSL, HEX, RGB and more are supported. |
Hello, World!
| |
{{{bg}}} | Background color. HSL, HEX, RGB and more are supported. |
Hello, World!
|