Template:Codeblue

From Wikibooks, open books for an open world
Jump to navigation Jump to search
{{{1}}}
{{{2}}}



Summary[edit source]

Produces a box for displaying lines of code, poetry, or any other set of lines that need to remain in such a textual format.

Parameters[edit source]

Main Text Content Parameters[edit source]

  • {{{1}}}: Box heading text at the top. Enter 1= and then the text.
  • {{{2}}}: The code lines for the main content in the middle section. Enter 2= the code lines.

Outer Box Formatting Parameters[edit source]

  • align: Alignment of the box on the page; options are, left, middle, right.
  • background: The general background color of the box. This is overridden by fixed colors in the content section.
  • width: The overall width of the outer box. Set it to auto to stretch to fit the longest line, or specify a pixel width and it will wrap lines of code.

Code Content Formatting Parameters[edit source]

  • cff: The font family for the code lines.

Example of Use[edit source]

Writing the following code line in editing mode...

{{codeblue|1=This is my heading text...|2=
 a=3
 s=4
 d=5
 a=s=d=12
HHHHHHHHHH
IIIIIIIIII
0000000000
OOOOOOOOOO
1111111111
llllllllll
}}

...Produces this code box...

This is my heading text...
a=3
s=4
d=5
a=s=d=12
HHHHHHHHHH
IIIIIIIIII
0000000000
OOOOOOOOOO
1111111111
llllllllll