Markdown構文ガイド
ドキュメントフォーマットの基本構文
概要
Markdownは、プレーンテキストにフォーマットを加える軽量マークアップ言語です。2004年John Gruber考案、今や世界で広く使われています。
MarkdownはWYSIWYGエディタとは異なります。Wordのようにボタンでフォーマットするのではなく、テキストに構文を加えて、どの語句をどう見せるか指定します。
見出し
見出しは語やフレーズの前に#を置きます。#の数がレベル(例:###でレベル3)になります。
Heading level 1
Heading level 2
Heading level 3
Heading level 4
Heading level 5
Heading level 6
段落
段落は空行で区切ります。
It lets me write easily.
<p>It lets me write easily.</p>
I really like using Markdown.
It lets me write easily.
改行
改行するには、行末にスペースを2つ以上入れてEnter。
And this is the second line.
And this is the second line.</p>
This is the first line.
And this is the second line.
強調
太字または斜体で強調できます。
太字
語やフレーズの前後に**または__を置く。
I just love bold text.
I just love bold text.
斜体
語やフレーズの前後に*または_を置く。
The cat meows.
The cat meows.
太字と斜体
前後に***または___を置く。
This text is really important.
This text is really important.
引用
段落の前に>を置く。
Dorothy followed her through many of the beautiful rooms in her castle.
ネストした引用
ネストする段落の前に>>を置く。
>
>> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
Dorothy followed her through many of the beautiful rooms in her castle.
The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
リスト
番号付き・番号なしリストを作れます。
番号付きリスト
数字とピリオドで各行を始める。1から始める。
2. Second item
3. Third item
4. Fourth item
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<li>Fourth item</li>
</ol>
- First item
- Second item
- Third item
- Fourth item
番号なしリスト
各行を-、*、+のいずれかで始める。
- Second item
- Third item
- Fourth item
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<li>Fourth item</li>
</ul>
- First item
- Second item
- Third item
- Fourth item
コード
語やフレーズをバッククォート`で囲む。
At the command prompt, type nano.
コードブロック
各行を4スペース以上またはタブでインデントするか、```でブロックの前後を囲む。
{
"firstName": "John",
"lastName": "Smith",
"age": 25
}
```
{
"firstName": "John",
"lastName": "Smith",
"age": 25
}水平線
***、---、___のいずれかだけの行を作る。
リンク
リンクテキストを[ ]で囲み、直後にURLを( )で囲む。例:[Duck Duck Go](https://duckduckgo.com)。
My favorite search engine is Duck Duck Go.
リンクにタイトルを付ける
URLの後にダブルクォートでタイトルを追加すると、ホバー時のツールチップになる。
My favorite search engine is Duck Duck Go.
画像
!の後に[代替テキスト]と(URLまたはパス)。オプションでタイトルをダブルクォートで。

エスケープ
フォーマット用の文字をそのまま表示するには、前にバックスラッシュ\を置く。
* Without the backslash, this would be a bullet in an unordered list.
エスケープできる文字
バックスラッシュでエスケープできる例:
| \ | backslash |
| ` | backtick |
| * | asterisk |
| _ | underscore |
| { } | curly braces |
| [ ] | brackets |
| ( ) | parentheses |
| # | pound sign |
| + | plus sign |
| - | minus sign (hyphen) |
| . | dot |
| ! | exclamation mark |
| | | pipe |
表
---で各列のヘッダーを作り、|で列を区切る。
| --------- | ----------- |
| Header | Title |
| Paragraph | Text |
| Syntax | Description |
|---|---|
| Header | Title |
| Paragraph | Text |
整列
ヘッダー行の---の左・右・両側に:を付けて整列。
| :--- | :---: | ---: |
| This | This | This |
| column | column | column |
| will | will | will |
| align | align | align |
| left | center | right |
| 左揃え | 中央揃え | 右揃え |
|---|---|---|
| This | This | This |
| column | column | column |
| will | will | will |
| align | align | align |
| left | center | right |