Guia de sintaxe Markdown

Sintaxe essencial para seus documentos

Visão geral

Markdown é uma linguagem de marcação leve para texto formatado. Desde 2004 (John Gruber), uma das mais usadas no mundo.

Diferente de editores WYSIWYG: você adiciona sintaxe ao texto para indicar quais palavras ou frases devem ser formatadas.

Títulos

Coloque # antes de uma palavra ou frase. O número de # corresponde ao nível (ex.: ### para nível 3).

Markdown
HTML
Saída renderizada
# 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

Parágrafos

Parágrafos são separados por linhas em branco.

Markdown
HTML
Saída renderizada
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.

Quebras de linha

Termine uma linha com dois ou mais espaços e Enter.

Markdown
HTML
Saída renderizada
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.

Ênfase

Ênfase com negrito ou itálico.

Negrito

** ou __ antes e depois de uma palavra ou frase.

Markdown
HTML
Saída renderizada
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.

Itálico

* ou _ antes e depois de uma palavra ou frase.

Markdown
HTML
Saída renderizada
The *cat* meows.
The <em>cat</em> meows.

The cat meows.

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

The cat meows.

Negrito e itálico

*** ou ___ antes e depois de uma palavra ou frase.

Markdown
HTML
Saída renderizada
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.

Citações

Coloque > antes de um parágrafo.

Markdown
HTML
Saída renderizada
> 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.

Citações aninhadas

Coloque >> antes do parágrafo que quer aninhar.

Markdown
Saída renderizada
> 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.

Listas

Listas ordenadas e não ordenadas.

Listas ordenadas

Números com ponto antes de cada linha. A lista deve começar em 1.

Markdown
HTML
Saída renderizada
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

Listas não ordenadas

Comece as linhas com -, * ou +.

Markdown
HTML
Saída renderizada
- 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

Código

Coloque uma palavra ou frase entre backticks (`).

Markdown
HTML
Saída renderizada
At the command prompt, type `nano`.
At the command prompt, type <code>nano</code>.

At the command prompt, type nano.

Blocos de código

Indente cada linha com 4 espaços ou 1 tab, ou use ``` antes e depois do bloco.

Markdown
Saída renderizada
```
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}
```
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}

Linhas horizontais

Três ou mais ***, --- ou ___ em uma linha sozinhos.

Markdown
HTML
Saída renderizada
***
<hr>

---
<hr>

___
<hr>

Imagens

! seguido de [texto alt] e (URL ou caminho). Opcionalmente título entre aspas.

Markdown
HTML
Saída renderizada
![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

Escapando

Barra invertida \ antes de um caractere que seria usado para formatação, para exibi-lo literalmente.

Markdown
Saída renderizada
\* Without the backslash, this would be a bullet in an unordered list.

* Without the backslash, this would be a bullet in an unordered list.

Caracteres que podem ser escapados

Barra invertida para escapar, por exemplo:

\backslash
`backtick
*asterisk
_underscore
{ }curly braces
[ ]brackets
( )parentheses
#pound sign
+plus sign
-minus sign (hyphen)
.dot
!exclamation mark
|pipe

Tabelas

Use --- para o cabeçalho de cada coluna e | para separar colunas.

Markdown
Saída renderizada
| Syntax    | Description |
| --------- | ----------- |
| Header    | Title       |
| Paragraph | Text        |
SyntaxDescription
HeaderTitle
ParagraphText

Alinhamento

Coloque : à esquerda, direita ou ambos os lados dos --- na linha de cabeçalho para alinhar.

Markdown
Saída renderizada
| Align Left | Align Center | Align Right |
| :--- | :---: | ---: |
| This | This | This |
| column | column | column |
| will | will | will |
| align | align | align |
| left | center | right |
EsquerdaCentroDireita
ThisThisThis
columncolumncolumn
willwillwill
alignalignalign
leftcenterright