Template:Codeblock
|
{{{2}}} |
Contents |
[edit] Use, Limitations, Parameters, and Options
[edit] Use
Makes a light grey box for listing code blocks. The main function lies in the POEM tags, and this template simply make a DIV box as a container for the code block. The default font is Fixedsys since it emphasises punctuation well. The box has options to change its appearance. Call it as follows.
NOTE THE USE OF NOWIKI AND POEM TAG PAIRS.
It looks like this:
|
{| style="background:lightyellow; color:red; border-top:1px solid gray; border-right:1px solid black; border-bottom:1px solid black; border-left:1px solid gray;" cellspacing=0 cellpadding=5px align=left width=70% |
Notice in particular that the long code lines have been wrapped while the other spacings have been preserved.
[edit] Limitations
The <nowiki></nowiki> tags must immediately surround the code block and <poem></poem> tags must be added outside of these.
[edit] Parameters
There are two parameters which may be called by either their numbers or their label names.
- 1
- Parameter heading: Enter text for the top title for the code.
- 2
- Parameter content: Enter the code block and surround it in <nowiki></nowiki> tags.
[edit] Options
- width
- width of the box, default auto.
- align
- horizontal position of the box, default left.
- margin
- margins of the box, default 0 0 0 0, in sequence top, right, bottom, and left.
- background
- the background color of the box, default rgb(230,230,230), a light grey.
- color
- text color, default rgb(55,55,55), a dark grey.
- ff
- font family, default fixedsys, since it has good clarity.
- border
- the perimeter border of the box, default 1px solid rgb(220,220,220), shade of grey.
- padding
- text padding, default 10px 15px 15px 15px in sequence top, right, bottom, left.