Wiki Formatting: Text Formatting
There are some really basic rules about wiki text formatting:
- Usual text is typed as is. Line breaks don't matter.
- Text indentantion with less than three spaces is insignificant. Three or more spaces create an item list.
- No direct HTML is possible.
- An empty line results in a paragraph break (line break and an empty line) in the output text.
- A line break is printed if two colons :: are found at the end of a line.
- Text enclosed in two consequetive '' single quote prevents formatting of text. Four single quotes result in two in the output.
Text attributes can be turned on or off just as in HTML. The on/off sequences are however the same.
|__||Two underscores turn italics on or off.|
|**||Two stars turn bold on or off.|
|%%||Two percents signs turn underlining on or off.|
|%*||A percent followed by a star turns %-strike-through on or off.|
|==||Two equal signs switch text output to a
|^^||Two carets remove white space to the left and right side of the carets.|
|%:[[fgcolor] [,bgcolor]]:||Sets fgcolor as foreground and bgcolor as background color. Both colors are optional, if none is given the last previous color sequence is turned off. Both color values can be a hexadecimal color value or lowercase color name.|
|%[class]-||Applies the text formatting class class to the following text. class must be defined in the wiki's stylesheet. If class is omited class formatting is turned off.|
|%[class]=||Same as %- but applies also paragraph breaks (creates a DIV).|
In addition to the %= markup above
produces also a DIV of class name if found at the beginning of a line. E.g. .wikiseq creates a <DIV CLASS="wikiseq"> and is equivalent with %wikiseq=. So "dot-diversions" are basically just a different notation.
The diversion ends when two dots at the beginning of a line are found. If the markup is followed by some text
only text is enclosed in the DIV.
Wiki markup that produces a HTML heading must start with three dashes at the beginning of the line, followed be the heading level:
followed by the heading's text. E.g. ---2 creates a level 2 heading.
is an alternative to create a H3 heading. Adding a second + creates a H4 and a third a H5 heading.
puts a paragraph break P before and after text which is printed in bold.
prints a horizontal rule.
yawk supports preformatted paragraphs with two sequences, one for printing text as-is and one with markup interpretation.
The sequences work as follows:
- Both sequences start with three dashes followed by one of the type characters : or %c-=.
- %c-= prints the following text as is, : interprets wiki markup.
- If the optional # is present, the text is printed with leading line numbers.
- The start sequence may be followed by a style class parameter.
- If a double quoted string is found the text is printed as subtitle below the preformatted text block.
- Although the scheme above looks like, the sequence does not allow blank inbetween up to the #.
As for preformatted sequences, they are only recognised if they appear at the beginning of the line. So quoting is not necessary.