This is a cheatsheet to help you write markdown for GitHub quickly, showing you the basics.
this is italic and this is bold . another italic and another bold
this is important
text. and percentage signs: % and %
this is *italic* and this is **bold** . another _italic_ and another __bold__
this is `important` text. and percentage signs: % and `%`
Here is some indented text
even more indented
even so more indented
you get the point
> Here is some indented text
>> even more indented
>>> even so more indented
>>>> you get the point
Also big title
==============
# Big title (h1)
## Middle title (h2)
### Smaller title (h3)
#### and so on (hX)
##### and so on (hX)
###### and so on (hX)
- Item 1
- A corollary to the above item.
- Yet another point to consider.
- Item 2
- A corollary that does not need to be ordered.
- This is indented four spaces, because it's two spaces further than the item above.
- You might want to consider making a new list.
- Item 3
- The numbers you put
- do not actually
- matter at all 2. so the list still works even when not using proper enumeration
- You can also use dashes or plus symbols
- Like this
1. Item 1
1. A corollary to the above item.
2. Yet another point to consider.
2. Item 2
* A corollary that does not need to be ordered.
* This is indented four spaces, because it's two spaces further than the item above.
* You might want to consider making a new list.
3. Item 3
4. The numbers you put
7. do not actually
5. matter at all
2. so the list still works even when not using proper enumeration
- You can also use dashes or plus symbols
+ Like this
To use keyboard keys, wrap the key in <kbd>
. For example, to show CONTROL+V you would type: <kbd>CONTROL</kbd>+<kbd>V</kbd>
.
Github also brings some nice Emoji support: π β€οΈ πΊ π π βοΈ
:heart: :beer: :up: :cool: :phone:
This is an example inline link and another one with a title.
Links can also be reference based: reference 1 or reference 2 with title.
This is an [example inline link](http://lmgtfy.com/) and [another one with a title](http://lmgtfy.com/ "Hello, world").
Links can also be reference based: [reference 1][ref1] or [reference 2 with title][ref2].
[ref1]: http://revolunet.com
[ref2]: http://revolunet.com "rich web apps"
A sample image with alt:

As links, images can also use references instead of inline links:
![revolunet logo][revolunet-logo] [revolunet-logo]: http://www.revolunet.com/static/parisjs8/img/logo-revolunet-carre.jpg "revolunet logo"
![revolunet logo][revolunet-logo]
[revolunet-logo]: http://www.revolunet.com/static/parisjs8/img/logo-revolunet-carre.jpg "revolunet logo"
It's quite easy to show code in markdown files.
Backticks can be used to highlight
some words.
Also, any indented block is considered a code block.
<script>
document.location = 'http://lmgtfy.com/?q=markdown+cheat+sheet';
</script>
The recommended way, however, is to append three ` before the block of code, and three at the end of the code. In the first line, you can write the language the block of code is written in so that it gets automatically highlighted.
For example, some Python code:
import random
class CardGame(object):
""" a sample python class """
NB_CARDS = 32
def __init__(self, cards=5):
self.cards = random.sample(range(self.NB_CARDS), 5)
print 'ready to play'
```python
import random
class CardGame(object):
""" a sample python class """
NB_CARDS = 32
def __init__(self, cards=5):
self.cards = random.sample(range(self.NB_CARDS), 5)
print 'ready to play'
```
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 |:
Note that the columns don't need to match the text exactly.
First Header | Second Header |
---|---|
Content Cell | Content Cell |
Content Cell | Content Cell |
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 |
| First Header | Second Header |
| ------------- | ------------- |
| Content Cell | Content Cell |
| Content Cell | Content Cell |
You can also include inline Markdown such as links, bold, italics, or strikethrough:
Name | Description |
---|---|
Help | |
Close | Closes a window |
| 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 |
| 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.
This plugin and this sample file is proudly brought to you by the revolunet team, and was greatly simplified, fixed, and overall cleaned by pyrobisqit
It's worth noting that generating multiple
blockquote
>
tags (e.g.>>>
) to indent text is not going to generate semantic HTML; nestedblockquote
tags (often used in the 'early days' before CSS to do exactly this) are generally not good current practice.