Structure

  • Heading 1: prefix with hash (#), or ==== on the next line
  • Heading 2: prefix with double hash (##) or ---- on the next line
  • Horizontal rule: four hyphens (----) on an isolated line
  • Block quote: prefix each line with greater-than sign (>)
  • Code blocks: three backticks with language (```python) is supported, but does not work in the preview. Alternatively, indent each line by 4 spaces.
  • Tables: use fairly obvious ASCII-art

Inline text

  • Emphasis: surround with underscore (_)
  • Strong emphasis: surround with double asterisk (**)
  • Strike-out: surround with double tilde (~~); does not work in the preview
  • Code: surround with backtick (`). Use more backticks than you want to include in the code. (```)
  • Highlight: surround with mark tags (<mark>, </mark>)
  • Subscript: surround with sub tags (<sub>, </sub>)
  • Superscript: surround with sup tags (<sup>, </sup>)

Lists

  • Unnumbered lists: prefix with asterisk (*)
  • Numbered list: prefix with a number, value not important (1)
  • Todo lists: use an unsorted list with square-brackets and square-brackets-x ([ ] and [x]) as the first text item. Does not show correctly in the preview.

Links and images

  • Links:
    • URL in angle brackets (<http://url>)
    • Display text in square brackets, URL in round brackets ([display text](http://url))
    • Index/display text in square brackets, empty square brackets ([display text][]). Then, elsewhere in the document, index definition, colon, URL ([display text]: http://url)
  • Images:
    • Exclamation mark, alt-text in square brackets, URL in round brackets, optional title enclosed in double-quotes (![alt text](http://url "title text"))
    • Exclamation mark, alt-text in square brackets, index reference in square brackets (![alt text][index ref]). Then, elsewhere in the document, index definition, colon, URL, title text ([index ref]: http://url "Title text")
    • It seems that title text is not shown
    • If you want to suggest the size, you have to fall back to the HTML <img> tag with width and/or height properties.
  • Ensure that link and image references are unique in the document.

Escapes

  • Markdown uses a number of special characters to indicate various markup. Examples are code spans (surrounded by backticks `) and emphasised text (surrounded by underscores _).
  • To include one of these special characters as themselves, escape it with a backslash \. So
    • This is an underscore ‘_’
    • This is a backtick ‘`’
    • This is an angle-bracket ‘<’
    • This is a backslash ‘\’
    • None of these are in a code-span.
  • The special symbols are
    • \ backslash
    • ` backtick
    • * asterisk
    • _ underscore
    • # hash symbol
    • + plus sign
    • - hyphen, minus sign
    • . dot, period
    • ! exclamation mark
    • { } curly brackets
    • [ ] square brackets
    • ( ) round brackets
    • < > angle brackets

Examples

Structure

Heading 1

Heading 2

This is normal text

This is a block-quote text of one line

Back to normal text, followed by a code block

code block
more code

Back to normal text. We can also use the syntax-highlighting style, though it does not show in the preview.

  • Python
    1
    2
    3
    4
    
    #! python3
    
    class Xdef:
        pass
    
  • Shell
    1
    2
    3
    
    #! /bin/sh
    
    i=0; while true; do echo $i; i=$(($i + 1)); done; then a lot more stuff; to show what happens when we overflow
    

Inline

  • This is emphasis with underscores and with asterisks
  • This is strong emphasis with double underscores and with double asterisks
  • This is strike-out with double tilde
  • This is code with lots of backticks code with 4 backticks ````
  • This is highlight surrounded mark-tags
  • Subscript H2O
  • Superscript a x2

Lists

  • Unordered list item 1
  • Unordered list item 2
    1. Ordered sub-list item 1
    2. Ordered sub-list item 2
  • Back to the original list
    • Unordered sub-list item 1
  • Back to the original list again

Here is something

  • Todo list is not supported
  • Or maybe it is


Images

  • Reverse tango hook alt text, with link and title

  • Reverse tango hook alt text, with reference

  • Reverse tango hook alt text, using img tag
  • Stephen Irons

The link definitions are below this line in the source, but invisible in the presentation.