What is Markdown?
Markdown is a lightweight markup language with plain text formatting syntax. It is designed so that it can be converted to HTML and many other formats using a tool by the same name.
– Wikipedia Markdown
Syntax
Headers
# H1
## H2
### H3
#### H4
##### H5
###### H6
Alternatively, for H1 and H2, an underline-ish style:
Alt-H1
======
Alt-H2
---
Emphasis
Emphasis, aka italics, with *asterisks* or _underscores_.
Strong emphasis, aka bold, with **asterisks** or __underscores__.
Combined emphasis with **asterisks and _underscores_**.
Strikethrough uses two tildes. ~~Scratch this.~~
Emphasis, aka italics, with asterisks or underscores.
Strong emphasis, aka bold, with asterisks or underscores.
Combined emphasis with asterisks and underscores.
Strikethrough uses two tildes.
Scratch this.
Lists
1. First ordered list item
2. Another item
* Unordered list can use asterisks
- Or minuses
+ Or pluses
- First ordered list item
- Another item
- Unordered list can use asterisks
- Or minuses
- Or pluses
Links
There are two ways to create links.
[I'm an inline-style link](https://chiuhum.wang)
[I'm an inline-style link with title](https://chiuhum.wang "Chiuhum's Homepage")
[I'm a reference-style link][Arbitrary case-insensitive reference text]
[I'm a relative reference to a repository file](../#Overview)
[You can use numbers for reference-style link definitions][1]
Or leave it empty and use the [link text itself].
URLs and URLs in angle brackets will automatically get turned into links.
http://www.example.com or <http://www.example.com> and sometimes
example.com (but not on Github, for example).
Some text to show that the reference links can follow later.
[arbitrary case-insensitive reference text]: https://chiuhum.wang
[1]: https://chiuhum.wang
[link text itself]: https://chiuhum.wang
I’m an inline-style link with title
I’m a relative reference to a repository file
You can use numbers for reference-style link definitions
Or leave it empty and use the link text itself.
URLs and URLs in angle brackets will automatically get turned into links.
http://www.example.com or http://www.example.com and sometimes
example.com (but not on Github, for example).Some text to show that the reference links can follow later.
Images
Here's is my logo (hover to see the title text):
Inline-style:
![alt text](https://chiuhum.wang/favicon.ico "Logo Title Text 1")
Reference-style:
![alt text][avatar]
[avatar]: https://chiuhum.wang/favicon.ico "Logo Title Text 2"
Here’s is my logo (hover to see the title text):
Inline-style:
Reference-style:
Videos
They can’t be added directly but you can add an image with a link to the video like this:
<a href="http://www.youtube.com/watch?feature=player_embedded&v=YOUTUBE_VIDEO_ID_HERE
" target="_blank"><img src="http://img.youtube.com/vi/YOUTUBE_VIDEO_ID_HERE/0.jpg"
alt="IMAGE ALT TEXT HERE" width="240" height="180" border="10" /></a>
Or, in pure Markdown, but losing the image sizing and border:
[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/YOUTUBE_VIDEO_ID_HERE/0.jpg)](http://www.youtube.com/watch?v=YOUTUBE_VIDEO_ID_HERE)
Code and Syntax Highlighting
Code blocks are part of the Markdown spec, but syntax highlighting isn’t. However, many renderers – like Github’s and Markdown Here – support syntax highlighting. Which languages are supported and how those language names should be written will vary from renderer to renderer.
Inline `code` has `back-ticks around` it.
Inline
code
hasback-ticks around
it.
Blocks of code are either fenced by lines with three back-ticks
, or are indented with four spaces. I recommend only using the fenced code blocks – they’re easier and only they support syntax highlighting.
` `` javascript
var s = "JavaScript syntax highlighting";
alert(s);
` ``
` ``python
s = "Python syntax highlighting"
print s
` ``
` ``
No language indicated, so no syntax highlighting.
But let's throw in a <b>tag</b>.
` ``
1
2 var s = "JavaScript syntax highlighting";
alert(s);
1 |
|
1
2 No language indicated, so no syntax highlighting.
But let's throw in a <b>tag</b>.
1 | ## Tables |
[ ] for an empty checkbox
[x] for a checked checkbox
- [ ] for an empty checkbox
- [x] for a checked checkbox
**[⬆ top](#What-is-Markdown)**