Template:CodeBlock/doc: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 86: | Line 86: | ||
| align=center | {{Code|{{Param|lang}}}} | | align=center | {{Code|{{Param|lang}}}} | ||
|The name of the language displayed on the right side of the header. | |The name of the language displayed on the right side of the header. | ||
| {{CodeBlock|margin=5px|<nowiki>{{CodeBlock|lang= | | {{CodeBlock|margin=5px|<nowiki>{{CodeBlock|lang=csharp | ||
|<nowiki>using System; | |<nowiki>using System; | ||
Line 99: | Line 99: | ||
} | } | ||
}</nowiki>}}</nowiki>}} | }</nowiki>}}</nowiki>}} | ||
| {{Capsule|margin=5px|{{CodeBlock|lang= | | {{Capsule|margin=5px|{{CodeBlock|lang=csharp|margin=0|<nowiki>using System; | ||
namespace HelloWorld | namespace HelloWorld |
Revision as of 18:16, 13 August 2023

This is a documentation subpage for Template:CodeBlock.
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 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 by {{{lang}}}. ![]() |
Header
The parameters for adding a header with the code source and the name of the programming language are described below. Template:ModernNote
Name | Description | Example | Preview |
---|---|---|---|
{{{src}}} | The source of your code. | ||
{{{lang}}} | The name of the language displayed on the right side of the header. |