mdc implements the markdown basics plus some few extensions. In contrast to the original markdown I am not aiming too much for HTML. (Instead I want the source to be readable.) Consequently, this page is short.
mdc implements the following standard markups:
Inserting HTML tags is not supported. Underscores inside words are kept as-is.
All block element markups start at the beginning of a line.
|Horizontal line||Three or more
|Headings||One to six
|Numbered lists||Digit followed by
|Def. Lists||An indented
|List end||A single
|Code lines||Indent with 4 blanks|
|Code blocks||Start and end with a line of
|Tables||first non-white char is |; one line per row|
Lists (ordered an unordered) make all kinds of problems. First, it changes the indentation rules for lines: code line must now be 8 instead of 4 blanks (this is not implemented in mdc). The reason for this is that lines with 4 blanks indentation count to the list item. The second issue I have with lists is that it's unclear (I didn't find something about it) how they are ended.
That made me add a markdown extension: A dot
. indented to at
least one but not more that 3 blanks closes the lists up and including
the dot's indentation level.
- Item 1 - Item 2 . An (for whatever reason) indented paragraph not belonging to Item 2.
You may also use a
- instead of a
Definition lists are another extension I have added. They start
with an indented colon
: which must be followed by a blank. To be
recognized as definition term, the line must end with another
The following paragraphs are translated into the definition data.
: markdown : A simple markup definition, which can be translated into HTML but that is also human-readable in a text editor.
Tables are supported but only on the very basic level:
|(fitting on one input line),
|may be indented blanks,
:indicating that the previous table row continues.
To make tables look good in the plain-text they should be coded like this:
| **What** | **Markup** | | --------------- | ---------------------------------------- | | Horizontal line | Three or more `-` | | Headings | One to six `#` followed by the title |
Text is added to the previous row's cells, if the markdown line starts
: instead of
A preformatted code block begins and ends with three backticks
``` (or tilde chars
~~~) at the beginning of a line.
Text inbetween is copied to the output without formatting or word wrap.
If the backticks are followed by a (blank separated) underscore
text is formatted, that is, inline formatting rules are applied.
Linebreaks are still unchanged.
The whole code block may be indented with blanks. The amount of block
indentation is taken from the first line and removed from all
following lines. This can be turned off by adding a single quote
Beginning a line with
%--- name puts the following text into the
CSS diversion of class name. The block ends when a line
%--- is found in the input.