Markup

This site uses a custom markup based heavily on the Google Code Wiki specification, which uses symbols and whitespacing to define information instead of the more traditional and verbose tagging system. I provide a parser under a BSD license, here (browse). Some of the following examples are taken from Google Code [code.google.com].

The CSS is not defined inline, an example stylesheet to use can be found here

Headings

Input:
= Header 1 =
== Header 2 ==
=== Header 3 ===
==== Header 4 ====
Output:

Header 1

Header 2

Header 3

Header 4

Paragraphs can be indented as so:

Input:
Some person said:
  This is a quote by the person named above.
This line is not idented.
Output:
Some person said:
This is a quote by the person named above.
This line is not idented.

Input:
_italic_
*bold*
^super^script
,,sub,,script
~~strikeout~~
Output:
italic
bold
superscript
subscript
strikeout

And some combinations:

Input:
_*bold* in italics_
*_italics_ in bold*
*~~strike~~ works too*
~~as well as _this_ way round~~
Output:
bold in italics
italics in bold
strike works too
as well as this way round

Linking

Links are contained within square brackets. The first word is treated as the link,
and any more words are treated as the link texts. External links are automagically
set to target=_blank and the domain is printed in square brackets after the link
element (a la Slashdot)

Input:
Google can be found at [http://www.google.com]

Google can be found [http://www.google.com here]

Images are inserted automatically (provided they end in png, jpg, jpeg, gif, etc)

/img/php-power-micro.png

And may be put inside links:
[http://www.php.net /img/php-power-micro.png]
Output:
Google can be found at http://www.google.com [google.com]

Google can be found here [google.com]

Images are inserted automatically (provided they end in png, jpg, jpeg, gif, etc)

And may be put inside links:
[php.net]

Code

Code is delimited inside {{{ }}} blocks. Exactly what they represent can be manipulated by the contents of the top line.

Raw HTML

Input:
{{{raw
<a href="http://www.google.com">Google</a>
}}}
Output:

Literal/verbatim code

Verbatim code can be shown either inline or blocked.

Input:
Here is some inline html: `<a href="http://www.google.com">Google</a>`
Output:
Here is some inline html: <a href="http://www.google.com">Google</a>

Input:
{{{verbatim
<a href="http://www.google.com">Google</a>
}}}
Output:
<a href="http://www.google.com">Google</a>

If one has provided a syntax highlighting engine, language specific highlighting can be applied with the following syntax. The following uses Luminous.

Input:
{{{lang=html
<a href="http://www.google.com">Google</a>
}}}
Output:
 1 
<a href="http://www.google.com">Google</a>

Lists

Input:
The following is:
 * A list
 * Of bulleted items
  # This is a numbered sublist
  # Which is done by indenting further
 * And back to the main bulleted list

  * This is also a list
  * With a single leading space
  * Notice that it is rendered
   # At the same levels
   # As the above lists.
  * Despite the different indentation levels.
Output:
The following is:
  • A list
  • Of bulleted items
    1. This is a numbered sublist
    2. Which is done by indenting further
  • And back to the main bulleted list
  • This is also a list
  • With a single leading space
  • Notice that it is rendered
    1. At the same levels
    2. As the above lists.
  • Despite the different indentation levels.

Tables

Table cells are delimited by a double pipe, and title cells can be denoted by
placing an equals symbol in the first position of the cell content
(before any whitespace). The trailing || may not be omitted.
Input:
||= Year ||= Temperature (low) ||= Temperature (high) ||
|| 1900 || -10 || 25 ||
|| 1910 || -15 || 30 ||
|| 1920 || -10 || 32 ||
|| 1930 || _N/A_ || _N/A_ ||
|| 1940 || -2 || 40 ||
Output:
Year Temperature (low) Temperature (high)
1900 -10 25
1910 -15 30
1920 -10 32
1930 N/A N/A
1940 -2 40

Input:
||  ||= 1  ||= 2 ||= 3 ||
||= 1 || 1 || 2  || 3 ||
||= 2 || 2 || 4 || 6 ||
||= 3 || 3 || 6 || 9 ||
Output:
1 2 3
1 1 2 3
2 2 4 6
3 3 6 9

Alignment

Blocks can be aligned as so:

Input:
Left alignment (default)

#+ Centred
Alignment -#

#++ Right 
Alignment --#
Output:
Left alignment (default)

Centred
Alignment

Right
Alignment

Tables Of Contents

Input:
=Title=
\contents

=Title#2=
==subtitle==
==subtitle2==

=Title3=
==subtitle1==
===sub-subtitle===
===sub-subtitle2===
==subtitle2==
Output:

Title

Title#2

subtitle

subtitle2

Title3

subtitle1

sub-subtitle

sub-subtitle2

subtitle2

Last edited by mark at 14:52:02 24/10/10

Page loaded in 0.051s
1 calls to Luminous, total: 0.0021s, average: 0.0021s