はじめに
Markdown記法のチートシートです。
なんとなく使っていたので勉強がてらまとめました。
記法一覧
Type | Example |
---|---|
HEADERS | # This is an H1 |
BLOCKQUOTES | > This is a blockquote. |
LISTS | * Red * Green |
ORDERED LISTS | 1. Red 2. Green |
HORIZONTAL RULES | *** |
ITALIC | *single asterisks* |
BOLD FACE | **double asterisks** |
STRIKETHROUGH | ~~double asterisks~~ |
CODE | Use the `printf()` function. |
CODE BLOCKS | ```text This is a code block. ``` |
LINKS | [This link](http://example.net/) has no title attribute. |
IMAGES |  |
BACKSLASH ESCAPES | \*literal asterisks\* |
TABLES | | | HEADER | |:-:|--------| | 1 | | |
EMOJI | :+1: |
TASK LSITS | - [x] this is a complete item - [ ] this is an incomplete item |
HEADERS
# This is an H1
## This is an H2
###### This is an H6
BLOCKQUOTES
> This is a blockquote.
>
> > This is nested blockquote.
>
> Back to the first level.
-
Result
This is a blockquote.
This is nested blockquote.
Back to the first level.
LISTS
* Color
* Red
* Green
* Blue
> Blue is one of the three primary colours of pigments in painting and traditional colour theory, as well as in the RGB colour model.
> It lies between violet and green on the spectrum of visible light.
-
Result
- Color
-
Red
-
Green
-
Blue
Blue is one of the three primary colours of pigments in painting and traditional colour theory, as well as in the RGB colour model.
It lies between violet and green on the spectrum of visible light.
-
- Color
-
Tips
- インデントを下げる場合はスペース4つ
- 同じレベルに要素を追加したいときは更にスペース4つ
ORDERED LISTS
1. Red
2. Green
3. Blue
-
Result
- Red
- Green
- Blue
HORIZONTAL RULES
***
-
Result
ITALIC
*single asterisks*
-
Result
single asterisks
BOLD FACE
**double asterisks**
-
Result
double asterisks
-
Tips
- 3つでBOLD+ITALIC
***triple asterisks***
-
Result
triple asterisks
STRIKETHROUGH
~~double tilde~~
-
Result
double tilde
CODE
Use the `printf()` function.
-
Result
Use the
printf()
function.
CODE BLOCKS
```java
// This is a code block.
public void main(String[] args) {
System.out.println("Hello world.");
}
```
- Result
// This is a code block.
public void main(String[] args) {
System.out.println("Hello world.");
}
-
Tips
- コードブロック内にバッククォートを表示したいときは、より多い数のバッククォートでくくる
- それでもできない場合はインデントを下げる
````
```java
// This is a code block.
public void main(String[] args) {
System.out.println("Hello world.");
}
```
````
```
```java
// This is a code block.
public void main(String[] args) {
System.out.println("Hello world.");
}
```
```
- Result
```java
// This is a code block.
public void main(String[] args) {
System.out.println("Hello world.");
}
```
LINKS
[This link](http://example.net/) has no title attribute.
-
Result
This link has no title attribute.
-
Tips
-
参照リンクできる
This is reference-style link to [Google][1]. This is reference-style link to [Yahoo][2]. This is reference-style link to [Bing][3]. [1]: https://www.google.co.jp/ "Google" [2]: https://www.yahoo.co.jp/ "Yahoo" [3]: https://www.bing.com/ "Bing"
-
-
Result
This is reference-style link to Google.
This is reference-style link to Yahoo.
This is reference-style link to Bing.
IMAGES

-
Result
-
Tips
- LINKS同様参照リンクできる
BACKSLASH ESCAPES
\*literal asterisks\*
-
Result
*literal asterisks*
TABLES
| | HEADER |
|:-:|--------|
| 1 | |
-
Result
HEADER 1 -
Tips
- 右寄せ
|--:|--------|
- 左寄せ
|:--|--------|
- 中央寄せ
|:-:|--------|
- 右寄せ
EMOJI
:+1:
-
Result
TASK LISTS
- [x] this is a complete item
- [ ] this is an incomplete item
-
Result
- this is a complete item
- this is an incomplete item
参考
Daring Fireball - Markdown
Mastering Markdown · GitHub Guides