Template:Code/doc: Difference between revisions
Jump to navigation
Jump to search
1416006136 (talk | contribs) (updated descriptions for {{{bg}}}) |
mNo edit summary |
||
Line 2: | Line 2: | ||
This template will allow you to format text as a one-line code. The default style is based on Markdown. | This template will allow you to format text as a one-line code. The default style is based on Markdown. | ||
== Parameters == | == Parameters and Examples == | ||
{| class= | {| class=standard-table | style="width:100%;" | ||
|- | |- | ||
! Parameter | |||
! Description | |||
! Example | |||
! Preview | |||
|- | |- | ||
| {{param|color}} | | align="center" | {{Code|{{param|style}}}} | ||
| | | The style of the template. The following styles are available: | ||
:* {{Code|select=1|1}} - Outlined version. Does not support {{param|bg}} and {{param|color}}. | |||
:* {{Code|select=1|2}} - Desaturated version. Does not support {{param|bg}} and {{param|color}}. | |||
:* {{Code|select=1|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. | |||
| {{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!}}}}}} | |||
| {{Doc/PreviewBlock|margin=5px|{{Code|style=1|Hello, World!}}}} {{Doc/PreviewBlock|margin=5px|{{Code|style=2|Hello, World!}}}} {{Doc/PreviewBlock|margin=5px|{{Code|style=3|Hello, World!}}}} | |||
|- | |- | ||
| {{param| | | align="center" | {{Code|{{param|select}}}} | ||
| | | Text selection mode. The following values are available: | ||
:# {{Code|select=1|1}} - All (one click selection); | |||
:# {{Code|select=1|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!}}}}}} | |||
| {{Doc/PreviewBlock|margin=5px|{{Code|select=1|Hello, World!}}}} {{Doc/PreviewBlock|margin=5px|{{Code|select=2|Hello, World!}}}} | |||
|- | |||
| align="center" | {{Code|{{param|color}}}} | |||
| Text color. <br> HSL, HEX, RGB and more are supported. | |||
| {{CodeBlock|{{Code|{{tint|color=yellow|color}}<nowiki>=</nowiki>{{tint|color=green|#FFFFFF}}|{{tint|color=comment|Hello, World!}}}}}} | |||
| {{Doc/PreviewBlock|margin=5px|{{Code|color=#FFFFFF|Hello, World!}}}} | |||
|- | |||
| align="center" | {{Code|{{param|bg}}}} | |||
| Background color. <br> HSL, HEX, RGB and more are supported. | |||
| {{CodeBlock|{{Code|{{tint|color=yellow|bg}}<nowiki>=</nowiki>{{tint|color=green|rgba(144,42,38,.35)}}|{{tint|color=comment|Hello, World!}}}}}} | |||
| {{Doc/PreviewBlock|margin=5px|{{Code|bg=rgba(144,42,38,.35)|Hello, World!}}}} | |||
|- | |- | ||
|} | |} | ||
<includeonly>{{sandbox other|| | <includeonly>{{sandbox other|| | ||
[[Category:Markdown]] | [[Category:Markdown]] | ||
}}</includeonly> | }}</includeonly> |
Revision as of 14:46, 23 January 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. The default style is based on Markdown.
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 color. HSL, HEX, RGB and more are supported. |
Hello, World!
|