Basic writing
Paragraphs
Paragraphs in Markdown are just one or more lines of consecutive text followed by one or more blank lines.
You can create a heading by adding one or more # symbols before your heading text. The number of # you use will determine the size of the heading.
1 | # The largest heading (an <h1> tag) |
Block-quotes
You can indicate block-quotes with a >
1 | In the words of Abraham Lincoln: |
Styling text
1 | *This text will be italic* |
Both bold and italic can use either a * or an _ around the text for styling. This allows you to combine both bold and italic if needed.
1 | **Everyone _must_ attend the meeting at 5 o'clock today.** |
Lists
Unordered lists
You can make an unordered list by preceding list items with either a * or a -.
1 | * Item |
Ordered lists
You can make an ordered list by preceding list items with a number.
1 | 1. Item 1 |
Nested lists
You can create nested lists by indenting list items by two spaces.
1 | 1. Item 1 |
Code syntax highlighting
In-line formats
Use single back-ticks (`) to format text in a special mono-space format. Everything within the back-ticks appear as-is, with no other special formatting.
1 | Here's an idea: why don't we take `SuperiorProject` and turn it into `**Reasonable**Project`. |
Multiple lines
You can use triple back-ticks (```) to format text as its own distinct block.
1 | ``` |
Syntax highlighting
In fenced block, add an optional language identifier for syntax highlighting.
For example, to syntax highlight Ruby code:
1 | ```ruby |
Links
Link
You can create an in-line link by wrapping link text in brackets ( [ ]
), and then wrapping the link in parentheses ( ( )
).
For example, to create a hyper-link to www.github.com, with a link text that says, Visit GitHub!, you’d write this in Markdown: [Visit GitHub!](https://www.github.com)
.
Image
In-line image:
1 | ![Alt Msg](URL) |
Block image:
1 | ![Alt Msg][URL] |
GitHub Flavored Markdown
underscores in words
Where Markdown transforms underscores (_
) into italics, GFM ignores underscores in words. To emphasize a portion of a word, use asterisks (*
).
URL auto-linking
GFM will auto-link 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.
1 | http://example.com |
becomes: http://example.com
Strike-through
GFM adds syntax to create strike-through text, which is missing from standard Markdown.
1 | ~~Mistaken text.~~ |
becomes: Mistaken text.
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 |
:
1 | First Header | Second Header |
You can also add extra pipes on the ends:
1 | | First Header | Second Header | |
Dashes don’t need to match the length of text:
1 | | Name | Description | |
Finally, by including colons : within the header row, you can define text to be left-aligned, right-aligned, or center-aligned:
1 | | Left-Aligned | Center Aligned | Right Aligned | |
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.