A Markdown Cheatsheet
There is a phrase that goes something like this: “Read the instructions only as a last resort.” For those who absolutely will not read instructions, I provide this cheat sheet as familiarization with Markdown. For those who do read instructions, I present this cheat sheet as a refresher.
Markdown, a plain text markup format created by John Gruber. For more information and help, please visit his website at: http://www.daringfireball.net.
Markdown is a plain text formatting syntax. Punctuation characters are used to format the text. For example, an asterisk around a word or phrase gives it emphasis. Two asterisks around the word or phrase, make it bold.
Markdown, however, is more than an easy formatting scheme, it is also a software tool that converts the plain text formatting to HTML. Markdown is an appealing way to format plain text without having to resort to word processors, even if you don’t have to convert to HTML.
Headings
# Level 1 Heading
## Level 2 Heading
### Level 3 Heading
#### Level 4 Heading
##### Level 5 Heading
###### Level 6 Heading
Level 1 Heading
===============
Level 2 Heading
---------------
Paragraphs
This is a paragraph. Paragraphs are ended with a blank line.
This is a new paragraph.
Emphasis
You can do italics or even bold in two ways. The first is by surrounding the text with asterisks *
, while the second is with underscores _
.
This is *italics* with asterisks.
This is _italics_ with underscores.
This is **bold** with asterisks.
This is __bold__ with underscores.
Links
You can link to various websites:
Click [here](http://example.com "Optional Title") to visit a website.
You can also use reference links:
[This][id] is a reference link which is defined below.
[id]: http://example.com "Optional Title"
You can also use automatic links:
<http://automatic-link-to-url.com/>
<name@emailaddress.com>
Images
You can embed images like so:
![alternate text](./image.jpg "Optional Title")
You can also use the same syntax as with reference links:
![alternate text][id] for a reference defined below.
[id]: ./image.jpg "Optional Title"
Lists
You can use ordered lists:
1. Item one.
2. Item two.
3. Item three.
Or you can use unordered lists:
* Item one.
+ Item two.
- Item three.
You can mix and match with nested lists:
1. Item one.
* Subitem one.
* Subitem two.
2. Item two.
- Subitem one.
- Subitem two.
3. Item three.
1. Subitem one.
Code Blocks
You can indent with four or more spaces or a tab character to create a code block:
This is a normal paragraph, followed by a code block.
for (int i = 0; i < 10; i++) {
System.out.println("i = " + i);
}
The above will be displayed as a preformatted block of code.
Code Spans
You can surround a word with an accent grave (usually called a backtick) to show code. This is especially handy if we have some code (or some other word that we want to stand out) in the middle of a paragraph. For example, if we want to show “html,” as well as the angle brackets, in a sentence, we can surround it with backticks:
This is how we can show `<html>` in a sentence.
We will see:
This is how we can show
<html>
in a sentence.
You can use literal backticks by using more than one backtick, such as with this example:
`` `escaped backtick` ``
Our output will be:
`escaped backtick`
Blockquotes
You can use email-style angle brackets to specify block quotes, as follows:
> This is a block quote.
>> This is a nested (further indented) block quote.
Horizontal Rules
Use three or more dashes -
, underscores _
, or asterisks *
for horizontal rules, like so:
---
***
___
You can even have spaces between each character:
- - -