Markdown Guide

Welcome

This is a guide to basic Markdown. Marked also handles MultiMarkdown, which adds a few extra tricks. For more information on MultiMarkdown, see the MultiMarkdown User’s Guide .

Text

Markdown Result
This text is *emphasised*. This text is emphasised .
This text is **bold**. This text is bold .
Here's a quote:
> Excellent work, Kip!
Here's a quote:
Excellent work, Kip!

Links and Images

Link to [Google](http://google.com) Link to Google .
You should [email me](mailto:jane@example.com). You should email me .
My email address is <jane@example.com>. My email address is jane@example.com .
![Marked logo](http://marked2app.com/apple-touch-icon-114x114.png) The Marked logo

Headings

# Large Heading

Large Heading

## Medium Heading

Medium Heading

### Smaller Heading

Smaller Heading

Lists

Markdown Result
* Milk
* Bread
* Cheese
    * Cheddar (4 spaces or tab before asterisk)
    * Camembert
* Rice
(You can also use - or + instead of *)
  • Milk
  • Bread
  • Cheese
    • Cheddar
    • Camembert
  • Rice
1. Milk
2. Bread
3. Cheese
  1. Cheddar (4 spaces or tab before number)
  2. Camembert
4. Rice
  1. Milk
  2. Bread
  3. Cheese
    1. Cheddar
    2. Camembert
  4. Rice

Special

Markdown Result
A sentence, followed by a rule.
* * *
Another sentence.
A sentence, followed by a rule.

Another sentence.
Two \*literal asterisks\*, not to be confused with *emphasis*. Two *literal asterisks*, not to be confused with emphasis .

MultiMarkdown

You can choose between MultiMarkdown and Discount (GitHub Flavored Markdown) in the Behavior section of Marked preferences.

Super and Subscript

You can create superscript and subscript using ^ and ~ within blocks of text.

Text^super

        Text~sub
        

Will produce:

Textsuper

Textsub

Tables

          
            | First Header  | Second Header |
            | ------------- | ------------- |
            | Row 1 Cell 1  | Row 1 Cell 2  |
            | Row 2 Cell 1  | Row 2 Cell 2  |
          
        

Renders as:

First Header Second Header
Row 1 Cell 1 Row 1 Cell 2
Row 2 Cell 1 Row 2 Cell 2

In the second row of the table, use colons on either end of the row of dashes to indicate alignment for the column:

            
              | First Header  | Second Header |
              | ------------: | :------------ |
              | Row 1 Cell 1  | Row 1 Cell 2  |
            
          

This code will cause the first column to be right-aligned, and the second to be left aligned.

Footnotes

          
            Paragraph text with a footnote[^fn]

            [^fn]: This is the footnote text.
          
        

Renders as:

Paragraph text with a footnote [1]


  1. This is the footnote text.  ↩

In more recent versions of MultiMarkdown (like the one built into Marked), you can create footnotes inline using text(*footnote text*) syntax. Note that this will not be compatible with other processors or older versions of MultiMarkdown.

Cross-References


### Section header [myheaderid]
        

Renders as…


<h3 id="myheaderid">Section header</h3>
          

…and can be referenced with [link text][myheaderid] , which renders as a link that will jump to the referenced header.

Definition Lists

          
Apple
: Pomaceous fruit of plants of the genus Malus in the family Rosaceae.
: An american computer company.
          
        

Renders as:

Apple
Pomaceous fruit of plants of the genus Malus in the family Rosaceae.
An american computer company.

Fenced Code Blocks

Blocks of text beginning and ending with ``` will be formatted as pre/code blocks.

You can optionally add a language specifier for syntax highlighting: ```ruby .

Discount (GFM)

You can choose between MultiMarkdown and Discount (GitHub Flavored Markdown) in the Behavior section of Marked preferences.

Specifying image sizes

An image size is defined by adding an additional = width x height field to the image tag:

        ![Marked logo](http://marked2app.com/apple-touch-icon-114x114.png =100x100)
      

produces:

Marked logo

Alpha lists

Ordered lists with alphabetic labels are supported in the same way that numeric ordered lists are:

        
          a. first item
          b. second item
        
      

generates

  1. first item
  2. second item

Pseudo-protocols for [] links

[text](abbr:description)
The label will be wrapped by <abbr title=" description "></abbr>
[text](class:name)
The label will be wrapped by <span class=" name "></span>
[text](id:name)
The label will be wrapped by <a id=" name "></a>
[text](raw:text)

Text will be written verbatim to the output.

GitHub Flavored Markdown

GitHub uses “GitHub Flavored Markdown,” or GFM, across the site–in issues, comments, and pull requests. It differs from standard Markdown (SM) in a few significant ways, and adds some additional functionality.

If you’re not already familiar with Markdown, take a look at Markdown Basics. If you’d like to know more about features that are available in issues, comments, and pull request descriptions, such as task lists, read Writing on GitHub.

Differences from traditional Markdown

Multiple underscores in words

“Normal” Markdown transforms underscores (_) into italics, such that wow_great_stuff becomes wow_great_stuff.

It is not reasonable to italicize just _part_ of a word, especially when you’re dealing with code and names often appear with multiple underscores. Therefore, GFM ignores multiple underscores in words.


      perform_complicated_task
      do_this_and_do_that_and_another_thing
      

becomes

perform_complicated_task
do_this_and_do_that_and_another_thing

URL autolinking

GFM will autolink standard URLs, so if you want to link to a URL (instead of setting link text), you can simply enter the URL and it will be turned into a link to that URL.


      http://example.com
      

becomes

http://example.com

Strikethrough

GFM adds syntax to create strikethrough text, which is missing from standard Markdown.


      ~~Mistaken text.~~
      

becomes

Mistaken text.

Fenced code blocks

Standard Markdown converts text with four spaces at the beginning of each line into a code block; GFM also supports fenced blocks. Just wrap your code in ````` (as shown below) and you won’t need to indent it by four spaces. Note that although fenced code blocks don’t have to be preceded by a blank line—unlike indented code blocks—we recommend placing a blank line before them to make the raw Markdown easier to read.


      Here's an example:

      ```
      function test() {
        console.log("notice the blank line before this function?");
      }
      ```
      

Keep in mind that, within lists, you must indent non-fenced code blocks _eight_ spaces to render them properly.

Syntax highlighting

Code blocks can be taken a step further by adding syntax highlighting. In your fenced block, add an optional language identifier and we’ll run it through syntax highlighting. For example, to syntax highlight Ruby code:


      ```ruby
      require 'redcarpet'
      markdown = Redcarpet.new("Hello World!")
      puts markdown.to_html
      ```
      

We use Linguist to perform language detection and syntax highlighting. You can find out which keywords are valid by perusing the languages YAML file.

Tables

You can create tables by assembling a list of words and dividing them with hyphens - (for the first row), and then separating each column with a pipe |:


      First Header  | Second Header
      ------------- | -------------
      Content Cell  | Content Cell
      Content Cell  | Content Cell
      

For aesthetic purposes, you can also add extra pipes on the ends:


      | First Header  | Second Header |
      | ------------- | ------------- |
      | Content Cell  | Content Cell  |
      | Content Cell  | Content Cell  |
      

Note that the dashes at the top don’t need to match the length of the header text exactly:


      | Name | Description          |
      | ------------- | ----------- |
      | Help      | Display the help window.|
      | Close     | Closes a window     |
      

You can also include inline Markdown such as links, bold, italics, or strikethrough:


      | Name | Description          |
      | ------------- | ----------- |
      | Help      | ~~Display the~~ help window.|
      | Close     | _Closes_ a window     |
      

Finally, by including colons : within the header row, you can define text to be left-aligned, right-aligned, or center-aligned:


      | Left-Aligned  | Center Aligned  | Right Aligned |
      | :------------ |:---------------:| -----:|
      | col 3 is      | some wordy text | $1600 |
      | col 2 is      | centered        |   $12 |
      | zebra stripes | are neat        |    $1 |
      

A colon on the left-most side indicates a left-aligned column; a colon on the right-most side indicates a right-aligned column; a colon on both sides indicates a center-aligned column.