Template:CodeBlock/doc: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 3: | Line 3: | ||
== Usage == | == Usage == | ||
Just insert {{MdCode|outline|<nowiki>{{ | Just insert {{MdCode|outline|<nowiki>{{CodeBlock|YourText}}</nowiki>}} into the page and replace '''YourText''' with your content to make the code block styling work. | ||
<br>'''Manage Wiki Formatting:'''<br> | <br>'''Manage Wiki Formatting:'''<br> | ||
| Line 9: | Line 9: | ||
<br>'''Switching Styles:'''<br> | <br>'''Switching Styles:'''<br> | ||
Insert {{MdCode|outline|<nowiki>style|</nowiki>}} after {{MdCode|outline|<nowiki>{{ | Insert {{MdCode|outline|<nowiki>style|</nowiki>}} after {{MdCode|outline|<nowiki>{{CodeBlock|</nowiki>}} and replace '''stylename''' with the name of an existing style. | ||
<br>'''Using Modifiers:'''<br> | <br>'''Using Modifiers:'''<br> | ||
| Line 15: | Line 15: | ||
<br>'''Adding a Block Header:'''<br> | <br>'''Adding a Block Header:'''<br> | ||
A description of including a header in a block can be found [[Template: | A description of including a header in a block can be found [[Template:CodeBlock/Header|here]]. | ||
== Styles == | == Styles == | ||
| Line 42: | Line 42: | ||
== Examples == | == Examples == | ||
{{ | {{CodeBlock|style=1|<nowiki>{{CodeBlock|margin=0|Hello World}}</nowiki>}} | ||
{{ | {{Doc/PreviewBlock|{{CodeBlock|margin=0|Hello World}}}} | ||
{{ | {{CodeBlock|style=1|<nowiki>{{CodeBlock|limited=1|height=50px|margin=0|1. Hello World | ||
2. Hello World | 2. Hello World | ||
3. Hello World | 3. Hello World | ||
4. Hello World}}</nowiki> | 4. Hello World}}</nowiki> | ||
}} | }} | ||
{{Documentation/PreviewBlock|{{ | {{Documentation/PreviewBlock|{{CodeBlock|limited=1|height=50px|margin=0|<nowiki>1. Hello World | ||
2. Hello World | 2. Hello World | ||
3. Hello World | 3. Hello World | ||
Revision as of 09:03, 22 January 2023
Don't forget to purge the contents of the base page upon creating or editing this subpage.
This template allows text to be formatted as a Markdown-style block of code.
Usage
Just insert {{CodeBlock|YourText}} into the page and replace YourText with your content to make the code block styling work.
Manage Wiki Formatting:
You can use <nowiki>YourText</nowiki> to disable processing of various commands that allow the wiki to style your text. Also, it can disable the template style.
Switching Styles:
Insert style| after {{CodeBlock| and replace stylename with the name of an existing style.
Using Modifiers:
Insert modifier=YourText| after {{MdCode| or style| and replace "modifier" with the name of an existing modifier. After the equal sign, you need to write the properties corresponding to the modifier.
Adding a Block Header:
A description of including a header in a block can be found here.
Styles
| Name | Description |
|---|---|
default |
enabled by default, but disabled if other styles are activated |
limited |
default design with limited height (after reaching the maximum, scrolling will be activated) |
outline |
less saturated version with outline |
outline-limited |
same as outline, but with a limited height (after reaching the maximum, scrolling will be activated) |
Modifiers
| Name | Description |
|---|---|
height |
controls the height of styles with limited height (default auto)
|
margin |
controls margin (default 5px 0 0 0)
|
Examples