Monkey Documentation

Module brl.markdown

The markdown module converts easy to read/write plain text (known as markdown) to html, using a simple text formatting syntax. More...


Classes:
Interfaces:

Detailed Discussion

The markdown module converts easy to read/write plain text (known as markdown) to html, using a simple text formatting syntax.

Markdown may also include html. Note that the special html characters <, > and & must therefore be 'escaped' using a backslash, the markdown escape character. For example, to insert a literal < into your markdown, you should use \<.

To convert markdown text to html, you must create a Markdown object and call its ToHtml method.

Markdown syntax

Paragraph separators

A blank line inserts a paragraph separator into the output.

Example

This
is
on
one
line...

This is a new paragraph!

Output

This is on one line...

This is a new paragraph!


Line breaks

Appending ~n to the end of a line will cause a line break to be inserted.

Example

Tightly~n
Packed~n
Lines~n

Output

Tightly
Packed
Lines


Text style

Text may be enclosed in the following style tags to control text style. Style tags may not span multiple lines.

*bold*
%italic%
`code`

Example

*This is in bold*, while %this is in italics%. And `this is some code`.

Output

This is in bold, while this is in italics. And this is some code.


Lists

* Unordered list

+ Ordered list

Example

Item
Another item
Yet another item

Item 1
Item 2
Item 3

Output

  • Item
  • Another item
  • Yet another item
  1. Item 1
  2. Item 2
  3. Item 3
Lists may contain paragraph separators.


Tables

| Header 1 | Header 2
| Cell 1 | Cell 2
| Cell 3 | Cell 4

Tables may not contain paragraph separators - a blank line ends the table.

Example

Flags   | Meaning
1       | Enable
2       | MidHandle

Output

FlagsMeaning
1Enable
2MidHandle


Headers

> Top level header
>> Second level header
>>> Third level header
>>>> Fourth level header
>>>>> Fifth level header
>>>>>> Sixth level header

Example

Title
>> Chapter 1
>> Chapter 2
>>> Figure 1

Output

Title

Chapter 1

Chapter 2

Figure 1


Links

Links may be created by enclosing the link target in [[ and ]]. In addition, alternate link text may be added using |.

Example

* [[Home]]
* [[Home|Go Home]]

Output


Horizontal dividers

A horizontal divider may be inserted by using one to three dash characters alone on a line.

Example

Above
---
Below

Output

Above


Below


Escaping markdown characters

The backslash character may be used to escape any special markdown characters. To insert a literal backslash, use \\.

Example

*This is bold*, but \*this isn't\*.

Output

This is bold, but *this isn't*.