Markdown記法 チートシート

# はじめに

Markdown記法のチートシートです。
なんとなく使っていたので勉強がてらまとめました。

# 記法一覧

| Type                                    | Example                                                            |
|:----------------------------------------|:-------------------------------------------------------------------|
| [HEADERS](#headers)                     | # This is an H1                                                    |
| [BLOCKQUOTES](#blockquotes)             | > This is a blockquote.                                            |
| [LISTS](#lists)                         | * Red<br> * Green                                                  |
| [ORDERED LISTS](#ordered-lists)         | 1. Red<br> 2. Green                                                |
| [HORIZONTAL RULES](#horizontal-rules)   | ***                                                                |
| [ITALIC](#italic)                       | \*single asterisks\*                                               |
| [BOLD FACE](#bold-face)                 | \*\*double asterisks\*\*                                           |
| [STRIKETHROUGH](#strikethrough)         | \~\~double asterisks\~\~                                           |
| [CODE](#code)                           | Use the \`printf()\` function.                                     |
| [CODE BLOCKS](#code-blocks)             | \`\`\`text<br> This is a code block.<br> \`\`\`                    |
| [LINKS](#links)                         | \[This link\](http://example.net/) has no title attribute.         |
| [IMAGES](#images)                       | \!\[Alt text\](/path/to/img.jpg "Optional title")                  |
| [BACKSLASH ESCAPES](#backslash-escapes) | \\\*literal asterisks\\\*                                          |
| [TABLES](#tables)                       | &#124; &#124; HEADER &#124;<br> &#124;:-:&#124;--------&#124;<br> &#124; 1 &#124; &#124; |
| [EMOJI](#emoji)                         | `:+1:`                                                             |
| [TASK LSITS](#task-lists)               | - [x] this is a complete item<br> - [ ] this is an incomplete item |

# HEADERS

```
# This is an H1

## This is an H2

###### This is an H6
```

- **Result**

    # 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.

- **Tips**

    - インデントを下げる場合はスペース4つ
    - 同じレベルに要素を追加したいときは更にスペース4つ

# ORDERED LISTS

```
1. Red
2. Green
3. Blue
```

- **Result**
    1. Red
    2. Green
    3. 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**

```java
// 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](http://example.net/) 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][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"

# IMAGES

```
![Alt text](/path/to/img.jpg "Optional title")
```

- **Result**

    ![Alt text](/path/to/img.jpg "Optional title")

- **Tips**

    - [LINKS](#links)同様参照リンクできる

# BACKSLASH ESCAPES

```
\*literal asterisks\*
```

- **Result**

    \*literal asterisks\*

# TABLES

```
|   | HEADER |
|:-:|--------|
| 1 |        |
```

- **Result**

    |   | HEADER |
    |:-:|--------|
    | 1 |        |

- **Tips**

    - 右寄せ
        `|--:|--------|`
    - 左寄せ
        `|:--|--------|`
    - 中央寄せ
        `|:-:|--------|`

# EMOJI

```
:+1:
```

- **Result**

    :+1:

# TASK LISTS

```
- [x] this is a complete item
- [ ] this is an incomplete item
```

- **Result**

    - [x] this is a complete item
    - [ ] this is an incomplete item

# 参考

[Daring Fireball - Markdown](http://daringfireball.net/projects/markdown/)
[Mastering Markdown · GitHub Guides](https://guides.github.com/features/mastering-markdown/)