Template:Code/doc: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 12: | Line 12: | ||
| align="center" | {{Code|{{param|style}}}} | | 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|1}} - Outlined version. Does not support {{param|bg}} and {{param|color}}. | ||
:* {{Code | :* {{Code|2}} - Desaturated version. Does not support {{param|bg}} and {{param|color}}. | ||
:* {{Code | :* {{Code|3}} - Clear version. Does not support {{param|bg}} but supports {{param|color}}. | ||
:* {{Code|style=3|Default}} - the default style is based on Markdown and supports the {{param|bg}} and {{param|color}} parameters. | :* {{Code|style=3|Default}} - the default style is based on Markdown and supports the {{param|bg}} and {{param|color}} parameters. | ||
| {{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|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!}}}}}} | ||
Line 21: | Line 21: | ||
| align="center" | {{Code|{{param|select}}}} | | align="center" | {{Code|{{param|select}}}} | ||
| Text selection mode. The following values are available: | | Text selection mode. The following values are available: | ||
:# {{Code | :# {{Code|1}} - All (one click selection); | ||
:# {{Code | :# {{Code|2}} - None (template content will not be highlighted). | ||
| {{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!}}}}}} | ||
| {{Doc/PreviewBlock|margin=5px|{{Code|select=1|Hello, World!}}}} {{Doc/PreviewBlock|margin=5px|{{Code|select=2|Hello, World!}}}} | | {{Doc/PreviewBlock|margin=5px|{{Code|select=1|Hello, World!}}}} {{Doc/PreviewBlock|margin=5px|{{Code|select=2|Hello, World!}}}} |
Revision as of 05:22, 12 February 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!
| |
{{{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}}} |
Background color. HSL, HEX, RGB and more are supported. ![]() |
Hello, World!
|