Посібник з синтаксису Markdown

Необхідний синтаксис для форматування документів

Огляд

Markdown – легка мова розмітки для додавання форматування до звичайного тексту. Створена Джоном Грубером у 2004 р., нині одна з найпопулярніших мов розмітки у світі.

Використання Markdown відрізняється від редактора WYSIWYG. У Word ви натискаєте кнопки; у Markdown ви додаєте синтаксис до тексту, щоб позначити, що має виглядати інакше.

Заголовки

Щоб створити заголовок, додайте # перед словом або фразою. Кількість # відповідає рівню (наприклад ### = рівень 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 пробілами або табуляцією в кожному рядку, або ``` перед і після блоку.

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