Template:Code: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{doc}} <includeonly><onlyinclude><code style="border-radius:3px; background-color:{{#switch:{{{p|}}}{{{preset|}}} |#default = rgba(0,0,0,.35); padding:2px 3px |0 = unset; padding:0 |1 = rgba(0,0,0,.16); padding:2px 3px |2 = rgba(0,0,0,.16); border:1px solid rgba(255,255,255,.1); padding:1px 3px |3 = rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.1); padding:1px 3px }}; user-select:{{{select|unset}}}; {{{style|}}}">{{#if:{{{highlight|}}}|{{#tag:syntaxhig...") |
No edit summary |
||
Line 4: | Line 4: | ||
|#default = rgba(0,0,0,.35); padding:2px 3px | |#default = rgba(0,0,0,.35); padding:2px 3px | ||
|0 = unset; padding:0 | |0 = unset; padding:0 | ||
|1 = rgba( | |1 = rgba(250,250,250,.16); padding:2px 3px | ||
|2 = rgba( | |2 = rgba(250,250,250,.16); border:1px solid rgba(255,255,255,.1); padding:1px 3px | ||
|3 = rgba( | |3 = rgba(5,5,5,.05); border:1px solid rgba(255,255,255,.1); padding:1px 3px | ||
}}; user-select:{{{select|unset}}}; {{{style|}}}">{{#if:{{{highlight|}}}|{{#tag:syntaxhighlight|{{{1}}}|lang={{{highlight}}}|inline=1|style="background-color:transparent;"}}|{{{1}}}}}</code></onlyinclude></includeonly> | }}; user-select:{{{select|unset}}}; {{{style|}}}">{{#if:{{{highlight|}}}|{{#tag:syntaxhighlight|{{{1}}}|lang={{{highlight}}}|inline=1|style="background-color:transparent;"}}|{{{1}}}}}</code></onlyinclude></includeonly> | ||
[[Category:Formatting templates]] | [[Category:Formatting templates]] |
Revision as of 02:48, 4 January 2025
Template Documentation [edit]
This template will allow you to format text as a one-line code.
Parameters and Examples
Parameters | Description | Examples | Preview |
---|---|---|---|
{{{preset}}}
|
Preset Template Styles. The following presets are available:
|
Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! | |
{{{select}}}
|
Text selection mode. Uses the user-select CSS property. Default value is unset .
|
Hello, World! Hello, World! | |
{{{style}}}
|
CSS styles. |
Hello, World! | |
{{{highlight}}}
|
Adds syntax highlighting for the language specified. ![]() |
<syntaxhighlight lang="c" inline="1" style="background-color:transparent;">int main() {return 0;} </syntaxhighlight> |