Document:Markdown Test Document
Author:bsp
Date:06-Oct-2018

1 Introduction

md is an extended re-implementation of the markdown1 utility script, originally released in 2004 by John Gruber.
md implements most of the markdown syntax, with some notable changes / omissions:
md also adds a couple of extensions:

2 Table of Contents

3 Command line options

md supports the following command line options:
-o outputfileSet output pathname.
The default output name is derived from the input file (replace suffix by .html)
-css cssurlSet CSS URL.
The default CSS name is derived from the input file (replace suffix by .css)
-Dvar=contentSet variable (see Variables)
-Dvar='<file'Set variable to content of file
-Bbuf=contentSet buffer (see Buffers)
-Bbuf='<file'Set buffer to content of file
-p
--partial
Enable partial document generation (skip <html> and <body>)
-cp class_prefixSet CSS class prefix
-ip icon_prefixSet icon resource prefix (default is icons/)
-x template_file

Use HTML template file.
The generated document body will be placed in buffer body and can be inserted at any point in the template via $(buf!body).
note_s
This automatically enables the partial processing mode.
-ae
—ascii-entities
Use plain ASCII for special character entities (unicode may confuse html-to-pdf tools)
-ne
—no-enumeration
Disable header enumeration
-eo
—enumeration-offset nr
Set header enumeration offset (1..n)
-il
—inline-data
Inline external files via data URIs and create self-contained document.
-h
—help
Show usage

3.1 Examples

$ tks app:md myfile.md 
Example 1
Markdown input will be read from myfile.md and HTML output will be written to myfile.html, using the myfile.css stylesheet.

$ tks app:md -o myoutput.html -css mystylesheet.css input.md 
Example 2
Markdown input will be read from myfile.md and HTML output will be written to myoutput.html, using the mystylesheet.css stylesheet.

$ tks app:md -x mytemplate.html myfile.md 
Example 3
Markdown input will be read from myfile.md and HTML output will be written to myfile.html, using the mytemplate.html template file and the myfile.css stylesheet.

4 Plain text paragraphs

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
note_l
Paragraphs are separated by empty lines.
A line break is inserted when a non-blank line is followed by another non-blank line.

5 Multi-column layout (print)

The +++col and +++/col char sequences are used to enable / disable the multi-column layout mode.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
caution_l
The multi-column layout will only appear in the print version of the document.

6 Text styles

Some italic textsuperscript text
Plain text Some emphasized text more plain text more emphasized textsuperscript text remaining plain text.
Some subscript text. strong text or strong text. strikethrough, fixed, more fixed text
A new paragraph with more regular text.

6.1 Text style table

ExampleOutput
*Emphasis*Emphasis
_Emphasis2_Emphasis2
**Strong**Strong
__Strong__Strong2
~~Strike-through~~Strike-through
`Fixed`Fixed
``Fixed``Fixed2
~Subscript~Subscript
^Superscript^Superscript
Text styles

7 Escaped chars

Escaped control chars: \ backslash, ` backtick, * asterisk, _ underscore, {} curly braces, [] square braces, () parenthesis, # hash, + plus, - minus, . dot, ! exclamation mark, ~ tilde, | pipe, < less than, > greater than.
Unescaped control chars like * asterisk or _ underscore. Freestanding chars like * will be treated as plain text.
Some escaped * asterisk. strong text with escaped asterisk* subscript with escaped ~ tilde.

8 Forced line breaks

8.1 Empty line with two spaces (<br>)

Forced line breaks are inserted when an empty line starts with two spaces:
Line 1



Line 5.

9 Forced page breaks (print)

A page break in the print version of the document can be inserted via
+++ 
tip_l
The default CSS automatically inserts a page break before each 1st level header.
caution_l
Page breaks will only appear in the print version of the document.

9.1 Linefeed paragraph via backslash

Under certain circumstances, for example when using custom CSS classes for advanced layouts, it may be necessary to force the end of the current paragraph.
A line that only consists of the \ character will insert a linefeed div (CSS class .lf):
line 1 
\ 
\ 
\ 
line 2 

line 1
line 2

10 Special char entities

❤ hello, world 😊
CodeOutput
(C)©
(R)®
(TM)
--
...
->
\⇒
<-
<=
<=>=
<!=>!=
Special char entities
CodeOutput
%:)%😊
%;)%😏
%:|%😐
%;(%😕
%:D%😄
%:P%😋
%:O%😦
%>(%😠
%:'(%😥
%8)%😲
%.)%😜
Smileys
CodeOutput
%<3%
%*%
Other entities

11 Variables

md`s pre-processor can be used to set variables, and insert them at any point in the document.
Variables are set via the $(var:<varname>=<value>) syntax.
Variable contents are inserted via the $(var:<varname>) syntax.

11.1 Set variable to inlined content

Set test to 42:
$(var:test=42) 
Variable test now contains >42<.
Set variable `test` to 3.1415 in one line: $(var:test=3.1415)>$(var:test)< 
Set variable test to 3.1415 in one line: >3.1415<
Set variable test to "hello, world.": Var content: >hello, world.<

11.2 Set variable to file content

Set variable `test` to file content: $(var:test=<res/var_content.txt). Var content: >$(var:test)< 
Set variable test to file content: . Var content: >A longer var content that is read from a file
and spans multiple lines.
Var Line 3
Var Line 4<

11.3 Externally defined vars

Variables can also be defined via the -D command line option
myextvar is currently defined as >(VAR "myextvar" IS UNDEFINED)<

11.4 Built-in special variables

The following variables have special meaning:
NameDescription
headerA built-in markdown snippet that creates a simple document header:
|noheader 
| Document: :|:$(buf!title) 
| Author:   :|:$(buf!author) 
| Date:     :|:$(buf!date) 
].header 
localdateCurrent date, e.g. 06-Mar-2019
localtimeCurrent time, e.g. `09:34:55"
localdatetimeCurrent date and time, e.g. 06-Mar-2019 09:34:55
localyearCurrent year, e.g. 2019
localmonthCurrent month, e.g. 3
localmonthnameshortCurrent month name, e.g. Mar
localmonthnamelongCurrent month name, e.g. March
localdayofmonthCurrent day of month, e.g. 6
localdayofmonthnameCurrent day of month, e.g. 6th
localdayofweeknameshortCurrent day of week, e.g. Wed
localdayofweeknamelongCurrent day of week, e.g. Wednesday
Special variables

12 Include markdown

12.1 Example

Markdown content can be included from an external file: >$(inc:res/var_content_3.md)< 
Markdown content can be included from an external file: >Content of external markdown file.<
tip_l
Alternatively, the value of a variable can be set to the content of a file via the -Dmyvar='<myfile.md' cmdline option, then the variable can be inserted at any point via $(var:myvar).

12.2 Parametrization

Along with variables and / or redefined link refs, this preprocessor feature can be used to parametrize the included markdown content by

13 Include HTML

In the postprocessor pass, additional, pre-generated HTML content can be included from files or memory buffers.

13.1 Example

Raw HTML content can be included from an external file: >$(inc!res/html_content.html)< 
Raw HTML content can be included from an external file: >hello, HTML world. <
note_l
Postprocessor instructions use the $(<cmd>!<arg>) syntax.
note_l
The reason for using a different syntax (! instead of :) is that this way the preprocessor can generate postprocessor instructions.

14 Buffer redirection

Sections of the document can be redirected to memory buffers by enclosing them in >>> and <<<:
>>>buf_id 
..buffer content.. 
<<< 
These buffers can then be inserted at any point in the generated document via the $(buf!buf_id) post-processor command.
tip_l
When creating multiple buffers, the <<< sequence before the next buffer can be omitted:
>>>buf1 
buf1 content 
>>>buf2 
buf2 content 
<<< 

14.1 Example

- A list that contains a nested buffer 
   - $(buf!mybuf) 
- Another list item 
results in:
  • A list that contains a nested buffer
    • This is the content of buffer mybuf.
      It may contain arbitrary markdown text, except for >>> and <<<.
      Here's a code block:
      some code 
      And a table:
      ab
      a1b1
  • Another list item
A list with a nested buffer

14.2 Special buffer names

The following buffer names have special meanings:
BufferDescription
bodyStores the main document body in template mode.
tocStores the table of contents
footnoteStores the current (global) footnote table
w3validatorStores a link to the validator.w3.org service.
titleDocument title (set via % header)
authorDocument author(s) (set via % header)
dateDocument title (set via % header)
Special buffers
tip_l
When the tool is run in template mode (-x), the output buffer is created by loading the provided template file and post processing it.
The generated markdown content can be inserted at any point in the template by inserting a buffer (e.g. $(buf!body)), or by including an external file (e.g. $(inc!myfile.html)).

15 Pre-formatted text (code block)

Code blocks are created by enclosing a section of the document in ~~~:
~~~ 
..fenced code block contents.. 
~~~ 
..fenced code block contents.. 

15.1 Indented code blocks

Unlike the original markdown implementation, four (or more) spaces at the beginning of a line do not produce pre-formatted code blocks.
Code blocks can be indented, and the indentation will not be visible in the output file:
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     another code block. 
      (indented in the markdown source file) 
       - raw text list item 1 
          - raw text list 1.1 
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     ] Indented code block example 
another code block. 
 (indented in the markdown source file) 
  - raw text list item 1 
     - raw text list 1.1 
Indented code block example
Some more text.

16 Block quotes

Block quotes are created by prepending a line with one or more > strings (the number of strings determines the block level).
> a block quote 
a block quote
> > a double block quote 
a double block quote
important_l
The > characters must be separated by spaces to distinguish them from the buffer redirection char sequence (>>>).
> a block quote 
> > directly followed by a double quote 
> and back to a single quote 
a block quote
directly followed by a double quote
and back to a single quote
Block quotes can be used with all paragraph types, e.g.
ab
a1b1
or
or
A block quote that contains a fenced code block:
..code block content.. 
some text

16.1 Citations

> The secret of getting ahead is getting started. The secret of getting started is breaking your complex overwhelming tasks into small manageable tasks, and then starting on the first one. 
> -- Mark Twain[-][^marktwain] 
The secret of getting ahead is getting started. The secret of getting started is breaking your complex overwhelming tasks into small manageable tasks, and then starting on the first one.
— Mark Twain4

16.1.1 Nested citations

A block quote
with a citation
— me
back to 1st level quote

17 Admonition paragraphs

17.1 NOTE:

NOTE: This is a note. 
note_l
This is a note.
note: This is a small note. 
note_s
This is a small note.

17.2 IMPORTANT:

IMPORTANT: This is an important note. 
important_l
This is an important note.
important: This is a small, important note. 
important_s
This is a small, important note.

17.3 TIP:

TIP: This is a tip. 
tip_l
This is a tip.
tip: This is a small tip. 
tip_s
This is a small tip.

17.4 CAUTION:

CAUTION: Take caution ! 
caution_l
Take caution !
caution: Take (a bit of) caution ! 
caution_s
Take (a bit of) caution !

17.5 WARNING:

WARNING: This is a warning. 
warning_l
This is a warning.
warning: This is a small warning. 
warning_s
This is a small warning.

17.6 TODO:

TODO: This is a to-do. 
todo_l
This is a to-do.
todo: This is a small to-do. 
todo_s
This is a small to-do.

17.7 Multi-paragraph admonitions

TIP: 
Admonitions can span multiple lines. 
They may contain arbitrary markdown, except for further admonitions. 
 
Lists: 
- list item 1 
- list item 2 
- list item 3 
 
Tables: 
|a|b 
|a1|b1 
 
> block quote 
=== 
tip_l
Admonitions can span multiple lines.
They may contain arbitrary markdown, except for further admonitions.
Lists:
  • list item 1
  • list item 2
  • list item 3
Tables:
ab
a1b1
block quote

17.8 Admonition icon resources

By default, admonition icons will link to the following files:
TypeFile
note:icons/note_s.png
NOTE:icons/note_l.png
important:icons/important_s.png
IMPORTANT:icons/important_l.png
tip:icons/tip_s.png
TIP:icons/tip_l.png
caution:icons/caution_s.png
CAUTION:icons/caution_l.png
warning:icons/warning_s.png
WARNING:icons/warning_l.png
todo:icons/todo_s.png
TODO:icons/todo_l.png
Icon resources

17.9 Alternative icon resource path

The default icon path prefix (icons/) can be changed via the -ip command line switch.

17.10 Inlined icon resources

When using the -il, —inline-data command line option, all external images, and the CSS file, will be embedded in the output document.
While this may increase the file size considerably (depending on the number of images and their sizes), this makes it possible to easily distribute the self-contained document via email, similar to a PDF.

18 Header 1 <test>

The syntax for atx-style headers is:
# myheader 
The number of # characters determines the header level (1..9).

18.1 Header 2

18.1.1 Header 3

18.1.1.1 Header 4

18.1.1.1.1 Header 5
18.1.1.1.1.1 Header 6
18.1.1.1.1.1.1 Header 7
18.1.1.1.1.1.1.1 Header 8
18.1.1.1.1.1.1.1.1 Header 9

19 Header 1 via =====

The syntax for setext-style level 1 headers is:
My Header 
========= 

19.1 Header 2 via ---

The syntax for setext-style level 2 headers is:
My Header 
--------- 

20 Horizontal rules

20.1 Dash

--- 

20.2 Asterisk

*** 

20.3 Asterisk (book)

* * * 
✽ ✽ ✽

20.4 Pagebreak (print)

+++ 

21 Lists

- list item 1 
- list item 2 
- list item 3 
* list item 1 
* list item 2 
* list item 3 
1) list item 1 
2) list item 2 
3) list item 3 
  1. list item 1
  2. list item 2
  3. list item 3
1. list item 1 
2. list item 2 
3. list item 3 
  1. list item 1
  2. list item 2
  3. list item 3


21.1 Unordered, nested lists

An unordered, nested list:
   - list item 1 
      - sublist item 1.1 
         - sublist item 1.1.1 
            - sublist item 1.1.1.1 
              List items can span multiple lines (when indented). 
 
              This includes newlines. 
              Some *formatted* text. 
         - sublist item 1.1.2 
      - sublist item 1.2 
   - list item 2 
   - list item 3 

21.2 Ordered, nested lists

An ordered list:
   1) list item 1 
      1. sublist item 1.1 
         1. sublist item 1.1.1 
            1) sublist item 1.1.1.1 
         2. sublist item 1.1.2 
      2. sublist item 1.2 
   2) list item 2 
   3) list item 3 
  1. list item 1
    1. sublist item 1.1
      1. sublist item 1.1.1
        1. sublist item 1.1.1.1
      2. sublist item 1.1.2
    2. sublist item 1.2
  2. list item 2
  3. list item 3

21.2.1 Start offset

Ordered lists can start at an offset:
  1. list item 4
  2. list item 5

21.2.2 Skip

It's also possible to skip sequence numbers:
  1. list item 6
  2. list item 8 (skip 7)
  3. list item 10 (skip 9)
  4. list item 12 (skip 11)
  5. list item 14 (skip 13)

21.2.3 Auto-enumeration

. one 
. two 
. three 
  1. one
  2. two
  3. three

21.3 List sub-titles

An unordered list with a sub title:
  • list item 1
  • list item 2
  • list item 3
Unordered list sub title

22 Links

See [this example page](http://www.example.com/doc3.html) 
See this example page.
Also see [this other example page](http://www.example.com/doc4.html "doc4 link description"). 
Also see this other example page.
note_l
The link description is shown as a tooltip when hovering over the link.
A [document internal link](#header-1-test). 
A document internal link.
A link to the [#introduction][]. 
A link to the introduction.
See <http//www.example.com/doc5.html>. 
See http//www.example.com/doc5.html.
Write an email to info@example.com (⇒ will be obfuscated (entity encoding)+ mailto: will be auto-preprended.).
An (obfuscated) FTP link: ftp://myuser:mypasswd@ftp.example.com.

Link declaration:
[example.com]: http://www.example.com 
Link reference:
A link to [example.com][]. 

A link to example.com.
A link to [another example site][example]. 
[example]: http://www.example.com 

A link to another example site.
Referenced link targets can be redefined:
See [this][1] or [that][2] document. 
 
[1]: http://www.example.com/doc1a.html 
[2]: http://www.example.com/doc1b.html 

See this or that document.
Also see [here][1] or [there][2]. 
 
[1]: http://www.example.com/doc2a.html 
[2]: http://www.example.com/doc2b.html 

Also see here or there.

23 Footnotes

23.1 Local footnotes

See [this][^1] or [that][^2] document. 
 
[^1]: http://www.example.com/doc3a.html "Document 3a" 
[^2]: http://www.example.com/doc3b.html "Document 3b" 
[^^] 

See this5 or that6 document.
5
6
note_l
The local footnote table is inserted when the list of footnote definitions is followed by [^^].
[^1]: http://www.example.com/doc3a.html "Document 3a" 
[^2]: http://www.example.com/doc3b.html "Document 3b" 
[^^] 
This can be used to insert a footnote table at the end of each logical document section, in addition to an optional, global footnote table at the end of the document.
Also see [^here][] or [^there][]. 
 
 [^here]: http://www.example.com/doc4a.html 
[^there]: http://www.example.com/doc4b.html 
[^^] 

Also see here7 or there8.
7
8

23.2 Global footnotes

The syntax for creating a global footnote is the same as for local footnotes.
A footnote becomes global when it has not been consumed in a local footnote table9.
note_l
The global footnote table is created by inserting the footnote buffer at any point in the document:
$(buf!footnote) 
While the buffer can be generated / inserted multiple times, once inserted, a footnote will be marked as done.
Each global footnote table will only contain footnotes that have not been displayed in previous tables.
On rare occasions it can be useful to link only to the footnote, e.g.
The sky is blue[-][^bluesky]. 

The sky is blue10.

24 Images

Here's an image: ![kitty cat (alt text)](res/image.png "kitty cat (title)") 
Here's an image: alt.
Here's an image without alt text and title: ![](res/image.png) 
Here's an image without alt text and title: alt.
Here's a scaled image: ![kitty cat (alt text)](res/image.png "kitty cat (title)" w=50). 
Here's a scaled image: alt.

24.3 Referenced images

Here's a referenced image: ![kitty cat (alt text)][kitty]. 
Here's a referenced image: alt.
Here's a referenced, scaled image: ![kitty cat (alt text)][kitty_scl]. 
Here's a referenced, scaled image: alt.
note_l
Scaled images will link to the original-size image resources.

24.4 Sub-titled images

![kitty][] 
] Sub-titled image 
alt
Sub-titled image
note_l
Similar to links, the short-cut version of an image link omits the link id and the alt text is interpreted as the link id (as seen in the previous example).

24.5 Left-aligned images

![kitty][] 
].left 
 
This text is displayed right next to the image. 
 
It can span multiple paragraphs. 
 
- list item 1 
- list item 2 
 
More regular text below the image. 
].none 
alt
This text is displayed right next to the image.
It can span multiple paragraphs.
More regular text below the image.
tip_l
.left and .none are user-defined CSS classes.
It is possible to right-align images in a similar fashion (just edit the CSS).

25 Tables

25.1 Simple table

| Col A     | Col B (a wide column) | Col C 
| Data A1   | Data B1               | Data C1 
| Data A2   | Data B2               | Data C2 
| Data A3   | Data B3               | Data C3 
] Simple table 
Col ACol B (a wide column)Col C
Data A1Data B1Data C1
Data A2Data B2Data C2
Data A3Data B3Data C3
Simple table

25.2 Simple table with cell alignment

|:This is Column A  | This is Column B | This is Column C: 
| Data A1           | Data B1          | Data C1 
| Data A2           | Data B2          | Data C2 
| Data A3           | Data B3          | Data C3 
] Simple table with cell alignment 
This is Column AThis is Column BThis is Column C
Data A1Data B1Data C1
Data A2Data B2Data C2
Data A3Data B3Data C3
Simple table with cell alignment

25.3 Cell alignment in --- style table

|-------------------|------------------|------------------| 
| This is Column A  | This is Column B | This is Column C | 
|:------------------|------------------|-----------------:| 
| Data A1           | Data B1          | Data C1          | 
| Data A2           | Data B2          | Data C2          | 
| Data A3           | Data B3          | Data C3          | 
|---------------------------------------------------------| 
] Table cell alignment in --- style table 
This is Column AThis is Column BThis is Column C
Data A1Data B1Data C1
Data A2Data B2Data C2
Data A3Data B3Data C3
Table cell alignment in --- style table
|-------------------|------------------|------------------| 
| This is Column A  | This is Column B | This is Column C | 
|:------------------|:----------------:|-----------------:| 
| `fixed`           | *emphasis1*      | _emphasis2_      | 
| ``fixed2``        | **strong1**      | __strong2__      | 
| ~subscript~       | ^superscript^    | ~~strikethrough~~| 
| [a link][1]       | ![kitty][]       | regular text     | 
|---------------------------------------------------------| 
] Table cell text styles, links, and images 
This is Column AThis is Column BThis is Column C
fixedemphasis1emphasis2
fixed2strong1strong2
subscriptsuperscriptstrikethrough
a linkaltregular text
Table cell text styles, links, and images

25.5 Multi-line tables

|------------------------------|---------------------|------------------| 
| This is Column A             | This is Column B    | This is Column C | 
|:-----------------------------|---------------------|-----------------:| 
| Data A11                     | Data A12            | Data A13         | 
| Data A21                     | Data A22            | Data A23         | 
| Data A31                     | Data A32            | Data A33         | 
|                              |+Data A32.line2      |+Data A33.line2   | 
|                              |+Data A32.line3      |+Data A33.line3   | 
|                              |                     |+Data A33.line4   | 
| Data A41                     | Data A42            | Data A43         | 
|+$(inc!res/html_list.html)    |                     |                  | 
|-----------------------------------------------------------------------| 
] Multi-line table cells via + modifier 
This is Column AThis is Column BThis is Column C
Data A11Data A12Data A13
Data A21Data A22Data A23
Data A31Data A32
Data A32.line2
Data A32.line3
Data A33
Data A33.line2
Data A33.line3
Data A33.line4
Data A41
  • Item 1
  • Item 2
  • Item 3
Data A42Data A43
Multi-line table cells via + modifier

25.6 Column widths

|cols=15,10,25 
|-------------------|------------------|------------------| 
| This is Column A  | This is Column B | This is Column C | 
|:------------------|------------------|-----------------:| 
| Data A1           | Data B1          | Data C1          | 
| Data A2           | Data B2          | Data C2          | 
| Data A3           | Data B3          | Data C3          | 
|---------------------------------------------------------| 
] Table cell widths via cols attribute 
This is Column AThis is Column BThis is Column C
Data A1Data B1Data C1
Data A2Data B2Data C2
Data A3Data B3Data C3
Table cell widths via cols attribute

25.7 Headerless tables

|noheader 
| left | right 
].noheader_table_example 
leftright
tip_l
Each table column can be styled differently by using the CSS :nth-child(<n>) feature, e.g.
.noheader_table_example .td:nth-child(1) { 
    font-size: 20; 
    font-weight: normal; 
    background-color: #eee; 
    padding-left: 0.25em; 
    padding-right: 0.25em; 
    border: 0px; 
} 

25.8 Complex tables (1)

This is Column AThis is Column BThis is Column C
This is some regular text.
With multiple paragraphs.
a code block. 
with multiple lines. 
Data B1
  1. list item 1b
  2. list item 2b
    • onetwo
      1.11.2
      2.12.2
    • list item 2b.2
  3. list item 3b
Data A2
  1. list item 1a
  2. list item 2a
    • sub list item 2a.1
  3. list item 3a
Data C2
Data A3Data B3
FirstSecondThird
sometablecontent
anotherrowof content
alt
Complex tables via buffer redirection

25.9 Complex tables (2)

This is Column AThis is Column B
Nested Column ANested Column B
This is some regular text.
With multiple paragraphs.
a code block. 
with multiple lines. 
  1. list item 1b
  2. list item 2b
    • onetwo
      1.11.2
      2.12.2
    • list item 2b.2
  3. list item 3b
Data A2Data B2
Data A3
FirstSecondThird
sometablecontent
anotherrowof content
alt
Nested buffer table
Nested Column ANested Column B
This is some regular text.
With multiple paragraphs.
a code block. 
with multiple lines. 
  1. list item 1b
  2. list item 2b
    • onetwo
      1.11.2
      2.12.2
    • list item 2b.2
  3. list item 3b
Data A2Data B2
Data A3
FirstSecondThird
sometablecontent
anotherrowof content
alt
Nested buffer table
Nested Column ANested Column B
This is some regular text.
With multiple paragraphs.
a code block. 
with multiple lines. 
  1. list item 1b
  2. list item 2b
    • onetwo
      1.11.2
      2.12.2
    • list item 2b.2
  3. list item 3b
Data A2Data B2
Data A3
FirstSecondThird
sometablecontent
anotherrowof content
alt
Nested buffer table
Nested Column ANested Column B
This is some regular text.
With multiple paragraphs.
a code block. 
with multiple lines. 
  1. list item 1b
  2. list item 2b
    • onetwo
      1.11.2
      2.12.2
    • list item 2b.2
  3. list item 3b
Data A2Data B2
Data A3
FirstSecondThird
sometablecontent
anotherrowof content
alt
Nested buffer table
Complex tables via buffer redirection 2

26 CSS classes

The following CSS classes can be used to modify the document's appearance:

26.1 Basic text styles and paragraphs

DescriptionCSS Class
Main body.body
Paragraph.p
Forced end of paragraph div (\).lf
Header.h[1..9]
Header enumeration span.h[1..9]_enum
Emphasized text.em
Emphasized text via _.em2
Strong text.strong
Strong text via __.strong2
Strikethrough text.s
Fixed text.code
Fixed text (double ``).code2
Subscript text.sub
Superscript text.sup
Preformatted text.pre
Basic text styles and paragraphs

26.2 Blockquotes and citations

DescriptionCSS Class
Blockquote.blockquote
Blockquote with a citation.blockquote_cite
Start of citation.blockquote_cite_begin
End of citation.blockquote_cite_begin
Citation footer.footer_cite
Blockquotes and citations

26.3 Images

DescriptionCSS Class
Image.img
Link to original image.oimg
Images

26.4 Lists

DescriptionCSS Class
Unordered root list.ulroot
Unordered sub list.ulsub
Ordered root list.olroot
Ordered sub list.olsub
Root list item.liroot
Root list item followed by sub-list.lirootwithsub
Last root list item.lirootlast
Sub list item.lisub
Sub list item followed by sub-list.lisubwithsub
Last sub list item.lisublast
Lists

26.5 Horizontal rules and printed page breaks

DescriptionCSS Class
Horizontal rule (***).hr_asterisk
Horizontal rule (* * *).hr_spaced_asterisk
Horizontal rule (* * *).hr_spaced_asterisk_inner
Printed page break.hr_pagebreak
Horizontal rules and printed page breaks

26.6 Subtitled paragraphs

DescriptionCSS Class
Sub-titled div (outer).subdiv_outer
Sub-titled div (inner).subdiv_inner
Sub-titled div (title).subdiv_title
Subtitled paragraphs

26.7 Tables

DescriptionCSS Class
Table.table
Table header row.thtr
Table header cell.thtd
Table data row.tr
Table data cell.td
Tables

26.8 Footnotes

DescriptionCSS Class
Footnote link (superscript).footnote_nr
Local Footnote table.footnote_table_local
Global Footnote table.footnote_table_global
Footnote table row.footnote_tr
Footnote table cell (number).footnote_td_nr
Footnote table cell (link).footnote_td_link
Footnote table link.footnote_a
Footnotes

26.9 Table of contents

DescriptionCSS Class
Table Of Contents div.toc_div
Table Of Contents enumeration div.toc_enum
Table of contents
tip_l
The CSS class names used in the table of contents are prefixed by toc_, e.g. toc_lirootwithsub.

26.10 Admonitions

DescriptionCSS Class
Admonition note: outer div.note_s_div_outer
Admonition NOTE: outer div.note_l_div_outer
Admonition important: outer div.important_s_div_outer
Admonition IMPORTANT: outer div.important_l_div_outer
Admonition tip: outer div.tip_s_div_outer
Admonition TIP: outer div.tip_l_div_outer
Admonition caution: outer div.caution_s_div_outer
Admonition CAUTION: outer div.caution_l_div_outer
Admonition warning: outer div.warning_s_div_outer
Admonition WARNING: outer div.warning_l_div_outer
Admonition note: table.notediv_s_table
Admonition NOTE: table.notediv_l_table
Admonition important: table.important_s_div_table
Admonition IMPORTANT: table.important_l_div_table
Admonition tip: table.tip_s_div_table
Admonition TIP: table.tip_l_div_table
Admonition caution: table.caution_s_div_table
Admonition CAUTION: table.caution_l_div_table
Admonition warning: table.warning_s_div_table
Admonition WARNING: table.warning_l_div_table
Admonition note: table row.note_s_div_tr
Admonition NOTE: table row.note_l_div_tr
Admonition important: table row.important_s_div_tr
Admonition IMPORTANT: table row.important_l_div_tr
Admonition tip: table row.tip_s_div_tr
Admonition TIP: table row.tip_l_div_tr
Admonition caution: table row.caution_s_div_tr
Admonition CAUTION: table row.caution_l_div_tr
Admonition warning: table row.warning_s_div_tr
Admonition WARNING: table row.warning_l_div_tr
Admonitions
DescriptionCSS Class
Admonition image (<img>).infoimg
Admonition note: icon column.note_s_div_td_icon
Admonition NOTE: icon column.note_l_div_td_icon
Admonition important: icon column.important_s_div_td_icon
Admonition IMPORTANT: icon column.important_l_div_td_icon
Admonition tip: icon column.tip_s_div_td_icon
Admonition TIP: icon column.tip_l_div_td_icon
Admonition caution: icon column.caution_s_div_td_icon
Admonition CAUTION: icon column.caution_l_div_td_icon
Admonition warning: icon column.warning_s_div_td_icon
Admonition WARNING: icon column.warning_l_div_td_icon
Admonition note: text column.note_s_div_td_text
Admonition NOTE: text column.note_l_div_td_text
Admonition important: text column.important_s_div_td_text
Admonition IMPORTANT: text column.important_l_div_td_text
Admonition tip: text column.tip_s_div_td_text
Admonition TIP: text column.tip_l_div_td_text
Admonition caution: text column.caution_s_div_td_text
Admonition CAUTION: text column.caution_l_div_td_text
Admonition warning: text column.warning_s_div_td_text
Admonition WARNING: text column.warning_l_div_td_text
Admonition note: inner div.note_s_div_inner
Admonition NOTE: inner div.note_l_div_inner
Admonition important: inner div.important_s_div_inner
Admonition IMPORTANT: inner div.important_l_div_inner
Admonition tip: inner div.tip_s_div_inner
Admonition TIP: inner div.tip_l_div_inner
Admonition caution: inner div.caution_s_div_inner
Admonition CAUTION: inner div.caution_l_div_inner
Admonition warning: inner div.warning_s_div_inner
Admonition WARNING: inner div.warning_l_div_inner
Admonitions (cont.)

26.11 Class name prefixes

The CSS class names can be prefixed via the -cp <class_prefix> command line option.

26.12 Custom CSS classes

Each paragraph can be assigned a custom CSS class:
Some text 
 
This is a div with a custom CSS class 
].myclass 
 
Some more text 

Some text
This is a div with a custom CSS class
Some more text
tip_l
Custom CSS classes can also be used for advanced layouts, e.g. text floating right next to an image or a table.

27 Creating a print version (PDF) of the document

While md itself cannot output PDF files, there are 3rd party tools that can transform the HTML output to a printable version of the document.
The @media print CSS selector can be used to select the paper size and margins, or fine-tune specific elements (e.g. automatically add page-breaks before or after certain elements, or prevent page breaks within certain elements).
The +++ char sequence inserts a forced page break, while +++col / +++/col enable / disable multi-column mode.
note_l
If all that is needed is a redistributable, self-contained version of the document, the -il command line option can be used to embed any additional resources (images, CSS) into the HTML file.

27.1 Pandoc / LaTeX / wkhtmltopdf

These are free, open-source HTML-to-PDF solutions which seem to work fine with simpler documents but currently (October 2018) have issues with tables (LaTeX error message).

27.2 Microsoft Print to PDF (Windows 10)

Windows 10 comes with a PDF printer driver that creates an excellent rendition of the document (including multi-column paragraphs).
It does have some (minor) drawbacks, though:

27.3 CutePDF (Windows 98/ME/2000/XP/2003/Vista/7/2012/8/8.1/10)

For earlier versions of Windows there are 3rd party PDF printer drivers like e.g. CutePDF11 (the output looks basically the same as with the Print to PDF driver).

27.4 Prince

This is a 3rd party, standalone software13 that is free for non-commercial use (available for Windows, MacOS, Linux, and FreeBSD).
It implements the W3 GCPM12 spec, preserves external and document internal links, supports multi-column paragraphs, and can create a nice looking table of contents with . leaders and page numbers.
1
2
3
4
9
10
11
12
13

Valid HTML 4.01 Transitional

Document created on 06-Mar-2019 09:34:55