Displaying Code with proper Indentation
In DarkWiki there are three ways to format a text in a monospaced font and thus keep indentation:
Code
You can use <code></code> for texts that are displayed inline. Example: Taffer
Pre
You can use <pre></pre> for texts that span multiple paragraphs: Example:
Taffer taffing tough.
Spacing
In addition, you can just add a space character in front of every line you want to quote, like this:
<<-- The first character of this line is a space || || \\// The line below has also a space as first character //\\ The above line has also a space as first character || ||
Just take a look at the source code of this very page to get an impression of how it works, it's really simple. Or mark the above sample with your mouse to see the empty spaces in front of each line.
If you have several lines of code, you just have to make sure that every line starts with a space. This also applies to line-spacers, as in the example below. Everything after the first space character counts as indentation.
// The following is an example of some code void foo() { if(a == b) a++; if(a > 19) return; }
Note, that the line between the a++; and the if(a > 19) is such a line-spacer.
If you omitted the space character in this line-spacer, it would produce an unintended result like this:
// The following is an example of some code void foo() { if(a == b) a++;
if(a > 19) return; }
Here, the code parts are separated, as the line-spacer contains no space character.
So, remember to put a space character in front of every line you want to display in a code block.