Template:CodeBlock: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Doc}} <includeonly> <onlyinclude><!-- --><div style="overflow:hidden;background-color:{{#switch:{{{style|}}}|1=rgba(0,0,0,.1)|rgba(0,0,0,.4)}};{{#switch:{{{style|}}}|1=border:1px solid rgba(48,48,48,1);|}}border-radius:4px; font-family:monospace,monospace; line-height:1.125rem; text-indent:0; white-space:pre-wrap; margin: {{{margin|.3em 0 .3em 0}}}"><!-- -->{{#if:{{{src|{{{lang|}}}}}}|<div style="display:flex;justify-content:space-between;backgroun...") |
No edit summary |
||
Line 3: | Line 3: | ||
<onlyinclude><!-- | <onlyinclude><!-- | ||
--><div style="overflow:hidden;background-color:{{#switch:{{{style|}}}|1=rgba( | --><div style="overflow:hidden;background-color:{{#switch:{{{style|}}}|1=rgba(250,250,250,.1)|rgba(250,250,250,.4)}};{{#switch:{{{style|}}}|1=border:1px solid rgba(48,48,48,1);|}}border-radius:4px; font-family:monospace,monospace; line-height:1.125rem; text-indent:0; white-space:pre-wrap; margin: {{{margin|.3em 0 .3em 0}}}"><!-- | ||
-->{{#if:{{{src|{{{lang|}}}}}}|<div style="display:flex;justify-content:space-between;background-color:rgba( | -->{{#if:{{{src|{{{lang|}}}}}}|<div style="display:flex;justify-content:space-between;background-color:rgba(250,250,250,.1); border-bottom:1px solid rgba(255,255,255,.1); font-family:monospace,monospace;line-height:1.125rem; text-indent:0; white-space:pre-wrap; padding:.5em"><!-- | ||
--><!-- | --><!-- | ||
--><div>{{{src|The source was not specified}}}</div><!-- | --><div>{{{src|The source was not specified}}}</div><!-- |
Latest revision as of 02:49, 4 January 2025
Template Documentation [edit]
This template formats the text as a block of code.
Parameters and Examples
Main
The main parameters are described below.
Name | Description | Example | Preview |
---|---|---|---|
{{{1}}}
|
Your code. It is recommended to wrap the template content with the <nowiki> tag.
|
| |
{{{margin}}}
|
Controls margins. |
| |
{{{style}}}
|
The style of the template. The following styles are available:
|
| |
{{{height}}}
|
Controls the height of the block. |
| |
{{{lines}}}
|
Manual: Numbered lines. |
| |
{{{start}}}
|
What number to start numbering from (default value is 1). The value can be negative. |
| |
{{{highlight}}}
|
Adds syntax highlighting for the language specified. ![]() |
|
Header
The parameters for adding a header with the code source and the name of the programming language are described below.

Name | Description | Example | Preview |
---|---|---|---|
{{{src}}}
|
The source of your code. |
| |
{{{lang}}}
|
The name of the language displayed on the right side of the header. |
|