Markdown 문법 가이드

문서 포맷의 기본 문법

개요

Markdown은 평문에 포맷을 더하는 가벼운 마크업 언어입니다. 2004년 John Gruber가 만들었고, 전 세계에서 널리 쓰입니다.

Markdown은 WYSIWYG 에디터와 다릅니다. Word처럼 버튼으로 포맷하지 않고, 텍스트에 문법을 넣어 어떤 구절을 어떻게 보일지 지정합니다.

제목

제목은 단어나 구절 앞에 #을 붙입니다. # 개수가 단계(예: ### = 3단계)입니다.

Markdown
HTML
렌더 결과
# Heading level 1
<h1>Heading level 1</h1>

Heading level 1

## Heading level 2
<h2>Heading level 2</h2>

Heading level 2

### Heading level 3
<h3>Heading level 3</h3>

Heading level 3

#### Heading level 4
<h4>Heading level 4</h4>

Heading level 4

##### Heading level 5
<h5>Heading level 5</h5>
Heading level 5
###### Heading level 6
<h6>Heading level 6</h6>
Heading level 6

단락

단락은 빈 줄로 구분합니다.

Markdown
HTML
렌더 결과
I really like using Markdown.

It lets me write easily.
<p>I really like using Markdown.</p>
<p>It lets me write easily.</p>

I really like using Markdown.

It lets me write easily.

줄바꿈

줄 끝에 공백 두 개 이상 넣고 Enter.

Markdown
HTML
렌더 결과
This is the first line.
And this is the second line.
<p>This is the first line.<br>
And this is the second line.</p>

This is the first line.
And this is the second line.

강조

굵게나 기울임으로 강조할 수 있습니다.

굵게

단어나 구절 앞뒤에 ** 또는 __.

Markdown
HTML
렌더 결과
I just love **bold text**.
I just love <strong>bold text</strong>.

I just love bold text.

I just love __bold text__.
I just love <strong>bold text</strong>.

I just love bold text.

기울임

단어나 구절 앞뒤에 * 또는 _.

Markdown
HTML
렌더 결과
The *cat* meows.
The <em>cat</em> meows.

The cat meows.

The _cat_ meows.
The <em>cat</em> meows.

The cat meows.

굵게·기울임

앞뒤에 *** 또는 ___.

Markdown
HTML
렌더 결과
This text is ***really important***.
This text is <strong><em>really important</em></strong>.

This text is really important.

This text is ___really important___.
This text is <strong><em>really important</em></strong>.

This text is really important.

인용

단락 앞에 >.

Markdown
HTML
렌더 결과
> Dorothy followed her through many of the beautiful rooms in her castle.
<blockquote><p>Dorothy followed her through many of the beautiful rooms in her castle.</p></blockquote>

Dorothy followed her through many of the beautiful rooms in her castle.

중첩 인용

중첩할 단락 앞에 >>.

Markdown
렌더 결과
> 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부터.

Markdown
HTML
렌더 결과
1. First item
2. Second item
3. Third item
4. Fourth item
<ol>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
  <li>Fourth item</li>
</ol>
  1. First item
  2. Second item
  3. Third item
  4. Fourth item

비순서 목록

각 줄을 -, *, + 중 하나로 시작.

Markdown
HTML
렌더 결과
- First item
- Second item
- Third item
- Fourth item
<ul>
  <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

코드

단어나 구절을 백틱 `로 감싸면 코드.

Markdown
HTML
렌더 결과
At the command prompt, type `nano`.
At the command prompt, type <code>nano</code>.

At the command prompt, type nano.

코드 블록

각 줄을 공백 4개 또는 탭 1개 들여쓰기, 또는 ```로 블록 앞뒤 감싸기.

Markdown
렌더 결과
```
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}
```
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}

수평선

***, ---, ___만 있는 줄.

Markdown
HTML
렌더 결과
***
<hr>

---
<hr>

___
<hr>

이미지

! 뒤에 [대체 텍스트]와 (URL 또는 경로). 선택적으로 따옴표로 제목.

Markdown
HTML
렌더 결과
![The San Juan Mountains](https://mdg.imgix.net/assets/images/san-juan-mountains.jpg "San Juan Mountains")
<img src="https://mdg.imgix.net/assets/images/san-juan-mountains.jpg" alt="The San Juan Mountains" title="San Juan Mountains">
The San Juan Mountains

이스케이프

포맷용 문자를 그대로 쓰려면 앞에 백슬래시 \.

Markdown
렌더 결과
\* Without the backslash, this would be a bullet in an unordered list.

* 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

---로 각 열 헤더를 만들고 |로 열 구분.

Markdown
렌더 결과
| Syntax    | Description |
| --------- | ----------- |
| Header    | Title       |
| Paragraph | Text        |
SyntaxDescription
HeaderTitle
ParagraphText

정렬

헤더 행 ---의 왼쪽·오른쪽·양쪽에 :를 넣어 정렬.

Markdown
렌더 결과
| Align Left | Align Center | Align Right |
| :--- | :---: | ---: |
| This | This | This |
| column | column | column |
| will | will | will |
| align | align | align |
| left | center | right |
왼쪽가운데오른쪽
ThisThisThis
columncolumncolumn
willwillwill
alignalignalign
leftcenterright