Notes on Markdown

Headings

Use one or more # to create headings:

  • # Heading 1
  • ## Heading 2
  • ### Heading 3

Paragraphs

  • Create paragraphs by using a blank line as separator.

    Paragraph 1

    Paragraph 2


Line Breaks

  • Create line breaks by using two or more spaces to end a line.

    Line 1
    Line 2


Emphasis

  • Bold

    Make bold text by surrounding by ** or __

  • Italic

    Make italic text by surrounding by * or _

  • Bold and italic

    Make bold and italic text by surrounding by *** or ___


Blockquotes

  • Single paragraph

    Begin a paragraph with a > to create a

    blockquote

  • Blockquotes with Multiple Paragraphs

    Use a > on the begining of every line

    "Multi paragraph
    quote
    this is" said Yoda.

  • Nested Blockquotes

    Use an additional > on the begining of every line

    First level

    Second level

    Third

  • Blockquotes including Other Elements

    Many elements, but not all, can be included in a blockquote.

    This is a list inside a blockquote:

    • a
    • b
    • c

Lists

  • Ordered lists

    Use any number followed by a period eg. 1. in the beginning of a line:

    1. First
    2. Second
    3. Third
    • Nesting List Items

      Use four spaces or a tab to nest items in an ordered list

      1. First
        1. a
        2. b
        3. c
      2. Second
      3. Third
  • Unordered lists

    Use -, * or + in the beginning of a line:

    • a list item
    • another, and
    • yet another
  • Adding paragraphs in lists

    Use four spaces or a tab in the beginning of the line to keep the list indentation.

    • Hello

      is a common greeting and

    • How are you?

      is another


Code

  • In-line Code

    Denote code by enclosing it in tick marks "`".

  • Block Code

    Enclose withing triple tick marks to denote code:

    General Code

    pi = 3.14

    Specific Language
    Place the name of the language inside {}after the first enclosing ticks to have the code executed in this language and have the results shown:
    R:

    pi <- 3.14
    pi

    Python:

    pi = 3.14
    print(pi)

Horizontal Rules

  • Use three or more asterisks (***), dashes (---), or underscores (___) on a line on their own to create a horizontal rule.

Links

  • A link is created by enclosing the link text in brackets [] and following it with its URL in parantheses ()

    [Google](https://www.google.com)Google

  • Adding titles

    The link’s title can be added by including it after the URL in the parantheses [Google](https://www.google.com "Google")Google

  • Quick URLs and Email Addresses

    Surround a URL or an email address with <> to quickly turn it into a link

  • Formatting Links

    Use * as per the Emphasis rules

  • Reference-style Links

    • Formating the First Part

      Use two sets of [], putting the title in the first and the label in the second

    • Formating the Second Part

      The second part consists of the label in [], followed by the URL in <> and an optional title in "", '' or ()

      [Basic Syntax][1]

      Basic Syntax


Images

  • Add an image by this format:

    ![alt text](image path or url "image title")


Escaping Characters

  • Use a \ before of the character in order to escape it, e.g. \\ for displaying \ .

Availability

There are several lightweight markup languages that are supersets of Markdown.
They include Gruber’s basic syntax and build upon it by adding additional elements
like tables, code blocks, syntax highlighting, URL auto-linking, and footnotes. Many
of the most popular Markdown applications use one of the following lightweight
markup languages:


Markdown Processors

There are dozens of Markdown processors available. Many of them allow you to add extensions that enable extended syntax. Check your processor’s documentation for more information.


Tables

  • To add a table, use three or more hyphens --- to create each column’s header, and use pipes | to separate each column.
  • Cell widths can vary.
  • You can optionally add pipes on either end of the table.
|Code    |Title    |
|--------|---------|
|01      |Apples   |
|02      |Oranges  |
Code Title
01 Apples
02 Oranges
  • Alignment

    You can align text in the columns to the left, right, or center by adding a colon (:) to the left, right, or on both side of the hyphens within the header row.

    |Code    |Title     |
    |:------:|---------:|
    |01      |Apples    |
    |02      |Oranges   |
    Code Title
    01 Apples
    02 Oranges
  • Formatting Text in Tables

    You can add links, code (not code blocks) and emphasis

  • Escaping the Pipe Character in Tables

    You can display a pipe (|) character in a table by using its HTML character code
    (&#124;).


Footnotes

To create a footnote1 reference, add a caret and an identifier inside brackets [^].


Linking to Heading IDs

The URL for a heading ID is a # followed by the title of the heading, in lower case and with spaces replaced by -, e.g. (#linking-to-heading-ids)


Definition Lists

To create a definition list, type the term on the first line. On the next line, type a colon followed by a space and the definition. You can add many definition lines.

First Term
The definition of the first term.
Second Item
First line of the definition.
Second line of the definition.

Strikethrough

To strikethrough words, use two tilde symbols ~~ before and after the words.


Task Lists

To create a task list, add dashes - and brackets with a space [ ] in front of task
list items. To select a checkbox, add an x in between the brackets [x].

  • [x] R rules
  • [ ] Java sucks!

Automatic URL Linking

Many Markdown processors automatically turn URLs into links, even without using brackets.

https://kostas.mastrogiannis.net


  1. <p>Footnote number 1.&#160;<a href=”#fnref1:1″ rev=”footnote” class=”footnote-backref”>&#8617;</a></p>