Markup Code
Lines and Paragraphs
Multiple paragraphs are marked as such by separating any two of them by an empty line:
First paragraph Second paragraph
Two lines that are not separated by an empty line but a single line break only are treated exactly like this: a line break is forced at the end of the first line and the second line starts afresh.
First line. Second line.
You can surpress a line break at the end of the first line by placing a backslash (\) at the end of that line. This folds the two successive pages together.
The quick brown fox \ jumps over the lazy dog.
Environmental Contexts
The content of a line can be treated in a special way by placing selected characters as the very first character at the beginning of that line. Depending on this character, called the selector, special formatting of the rest of the line takes place. You may put any number of blanks between the selector and the rest of the line to to make it stand out more clearly.
Selectors that are placed in front of subsequent lines and that are compatible in regard of the context are considered to be part of the same logical environmental context. Such a context can be thought of as block - a compound of several lines, each of which is supposed to be treated similarly. Two lines separated by an empty line, and thus creating two paragraphs, always break environmental contexts.
Escaping Selectors
You can escape the selector of a line by placing a backslash (\) in front of all other characters. Doing so, treats the rest of the line as verbatim text in the context of a single paragraph.
A backslash also escapes any special character that might appear somewhere in your text, enabling you to literally use such characters in your text:
This is not a link, but just bracketed text: [[Text]].
Paragraph Alignment
You can align the content of a paragraph to the left, right, center as well as justifying it, respectively, by calling upon a <, >, >< or <>-selector, respectively.
Note that you have to break the environmental context to alter the alignment of its content:
>< This line is centered. > Although not lead by "><", < the rest of this paragraph is also centered because it belongs to its predecessor's context.
yields
This line is centered.
Although not lead by a "><",
the rest of this paragraph is also centered
because it belongs to its predecessor's context.
Verbatim Output
An exclaimation mark selector tells Pie to treat the rest of the line as verbatim output, that is, to be displayed as is with no further formatting applied.
!#!/bin/sh !while [ 0 ] ; do ! echo Ping ! sleep 1 !done
renders this very script (without the leading exclaimation marks).
Comments
A semicolon marks a line as a comment. The rest of the line is simply skipped and not included in the output.
; Begin of header Once upon a time... ; End of text And they lived happily ever after.
A line with two semicolons prepended is also treated as a comment. However, unlike a single semicolon, the content of the line is still included in the output - yet as a hidden comment instead of actual text.
;; I am a comment
translates to the invisible (yet existing) HTML output of
<!-- I am comment -->
Comments of both types do not break environmental contexts, but are just skipped by the parser.
Separators
Three dashes (minus signs) put together as the only characters of a line create a horizontal separator and can be used to structure and separate multiple parts of a document.
Headlines and Titles
To create headlines of multiple levels you put a respective amount of =-signs at the beginning of the line. You can go down as far as five ='s to specify the fifth level of subtitles.
= Main Title I am the preamble == Sub Title In this section you learn to format your text. === Topic One === Topic Two [...]
Headlines always break environmental contexts, creating one-line contexts of their own. You may insert blank lines around them to make the section they introduce stand out more clearly. Catching up with the behaviour of other Wiki siblings, Pie allows you to terminate headlines with the same amount of = signs that opened them. However, this is highly optional.
Tables
Tables can be rendered via the pipe selector: A | as the first character of a line marks it as part of a table environment. The columns of a table row are separated from one another via further vertical bars, as is the end of the line to terminate the table row. All table rows must contain the same number of columns.
Per default, the contents of all table cells is aligned as determined either by the recipient's browser's settings or the applying CSS. To explicitely declare the contents of a cell to be horizontally aligned in a non-standard way, place >, <, >< or <> selectors as the first characters of the respective cell.
If an =-selector is put as either the very first character of a cell, or the first character after a cell's alignment specification, this cell is treated as part of a table header instead of an ordinary table row. Table cell may be padded with any number of white space characters on the right side to make the source more readable.
|=First Column|=Second Column|=Third Column| |alpha |beta |gamma| |<left |>< centered |> right|
translates to
| First Column | Second Column | Third Column |
|---|---|---|
| alpha | beta | gamma |
| left | centered | right |
Lists
Lists, foremost representatives of environmental contexts, are special insofar as their items can be nested within one another, the indent of a particular list item depending on the depth of the surrounding environment. A list context is either terminated by an empty line or any construct that forces an environment to end prematurely, as it is the case with headlines and horizontal separators.
Ordered and Unordered Lists
You start unordered, "bullited" lists with an asterix (*) at the beginning of a line. The number of *-signs determines the amount and level of indentation at the left side of the generated list item.
Ordered lists, that is, lists that continuously increase their items' counters, start with one or more plus- or pound-signs (+ or #) at the beginning of a line.
* Master item ** First sub item ** Second sub item * Master two ++ Count alpha ++ Count beta * Master three
translates to
- Master item
- First sub item
- Second sub item
- Master two
- Count alpha
- Count beta
- Master three
Definition Lists
Definition lists are made up of lines consisting of a definition term and a definition text. They are introduced by a colon at the beginning of a line, followed by the term, another colon, and the text.
:First:First item of the list :Second:Second item of the list **Alpha: First sub item **Beta: Second sub item :Third:The third item is a [[http://pie.ekkaia.org/|link]].
becomes
- First
- First item of the list
- Second
- Second item of the list
- Alpha: First sub item
- Beta: First sub item
- Third
- The third item is a link.
Note the double colon instead of a single colon to separate a term from its definition. Note also that there is only a single colon at the beginning of the line, regardless of its indent or placement inside other list items of different kinds and levels.
Text Spans
If a string of characters is enclosed in single brackets and the first character of this block turns out to be a special character, a selector, this block is treated as a local miniature environmental context called a span. Unlike environmental contexts that comprise entire lines, spans only apply to the text chunk between the opening and closing brackets.
Spans have the form
[<selector><contents>]
where <selector> is a single special character, and <contents> represents the text the context applies to. Spans can be placed in continuous text as well as nested inside environmental contexts, like lists and tables. Two or more spans must not be nested inside one another.
Verbatim Output
Just like an exclaimation mark at the beginning of a line introduces verbatim output, an exclaimation mark selector in a span calls upon the span's content to be rendered as a verbatim, monospaced text block.
[!This is code-like verbatim]
To give up the monospaced block style in favor of simple verbatim text, use the equal sign selector (=) instead. This allows arbitrary text to be passed through to the reader unescaped.
Emphasizing Text
A slash (/) selector prints the content of the text span in italics. An asterix (*) selector causes the text to printed in bold characters. An underscore (_) yields underlined text.
For the sake of simplicity and comfort, emphasizing text can also be evoked by enclosing that text in special characters. As a result, there is no need for brackets and, more importantly, for spans. You can place text between two underscore- or asterix-characters to render it emphasized or strong, respectively. The same takes effect, if the text is placed between a group of '' or ''' character strings. The special meaning of these characters is only triggered, if they stand for themselves, that is, do not appear in the middle of a word, but are enclosed in blanks, punctuational characters, or appear at the beginning or end of the line.
Emphasized: [/this] might be the same as _this_ or ''that''. Strong: [*this] might look like *this* and '''that'''.
Note that the use of spans on the one side and the simplified forms on the other, not only differs in regard of typing style and, maybe, slightly different output, but also in the function it embodies. The /, * and _ selectors explicitely enforce the use of italics, bold and underlined text, respectively, while the simplified forms call upon emphasized and strongly emphasized text. From the typographical point of view, the latter form modifies the meaning of the affected part of text, while the former just selects a different font style for that part.
Citations
Citations are triggered via a double quote selector.
["Believe nothing and be on your guard against everything.]
Monospaced
To mark a span as code (which browsers usually display using a monospaced font), use an at-sign (@) as a selector.
Keep [@/etc/passwd] secret!
Size Variation
A plus and minus sign call upon the content to be rendered as big and small, respectively.
This is [-small], whereas this is [+big].
Superscript and Subscript
Apostrophe (inverted comma) and comma signs call upon the content to be rendered as superscript and subscript, respectively.
a['2] = b['2] + c['2] p[,n] = (x[,n], y[,n], z[,n])
a2 = b2 + c2
pn = (xn, yn, zn)
Special Characters
Former software releases of Pie required special, non-ASCII characters to be composed by code names and code numbers. Not so any more! The current version of Pie uses UTF-8 character encoding instead of the limited range of the default 8-bit ISO-8859-x encoding, and consequently is capable of handling almost any existing Unicode character symbol. Just type these special characters using your keyboard. What you see is what you get!