Guida sintassi Markdown

Sintassi essenziale per i tuoi documenti

Panoramica

Markdown è un linguaggio di markup leggero per testo formattato. Dal 2004 (John Gruber) uno dei più usati al mondo.

Diverso dai lettori WYSIWYG: aggiungi sintassi al testo per indicare quali parole o frasi formattare.

Titoli

Metti # prima di una parola o frase. Il numero di # corrisponde al livello (es. ### per livello 3).

Markdown
HTML
Output renderizzato
# 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

Paragrafi

I paragrafi sono separati da righe vuote.

Markdown
HTML
Output renderizzato
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.

Interruzioni di riga

Termina una riga con due o più spazi e Invio.

Markdown
HTML
Output renderizzato
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.

Enfasi

Enfasi con grassetto o corsivo.

Grassetto

** o __ prima e dopo una parola o frase.

Markdown
HTML
Output renderizzato
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.

Corsivo

* o _ prima e dopo una parola o frase.

Markdown
HTML
Output renderizzato
The *cat* meows.
The <em>cat</em> meows.

The cat meows.

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

The cat meows.

Grassetto e corsivo

*** o ___ prima e dopo una parola o frase.

Markdown
HTML
Output renderizzato
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.

Citazioni

Metti > prima di un paragrafo.

Markdown
HTML
Output renderizzato
> 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.

Citazioni nidificate

Metti >> prima del paragrafo da nidificare.

Markdown
Output renderizzato
> 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.

Liste

Liste ordinate e non ordinate.

Liste ordinate

Numeri con punto prima di ogni riga. La lista inizia da 1.

Markdown
HTML
Output renderizzato
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

Liste non ordinate

Inizia le righe con -, * o +.

Markdown
HTML
Output renderizzato
- 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

Codice

Metti una parola o frase tra backtick (`).

Markdown
HTML
Output renderizzato
At the command prompt, type `nano`.
At the command prompt, type <code>nano</code>.

At the command prompt, type nano.

Blocchi di codice

Indenta ogni riga con 4 spazi o 1 tab, oppure ``` prima e dopo il blocco.

Markdown
Output renderizzato
```
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}
```
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}

Linee orizzontali

Tre o più ***, --- o ___ su una riga da soli.

Markdown
HTML
Output renderizzato
***
<hr>

---
<hr>

___
<hr>

Immagini

! seguito da [testo alt] e (URL o percorso). Opzionalmente titolo tra virgolette.

Markdown
HTML
Output renderizzato
![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

Escaping

Backslash \ prima di un carattere usato per formattazione, per mostrarlo literalmente.

Markdown
Output renderizzato
\* Without the backslash, this would be a bullet in an unordered list.

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

Caratteri escapabili

Backslash per escapare, ad es.:

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

Tabelle

Usa --- per l'intestazione di ogni colonna e | per separare le colonne.

Markdown
Output renderizzato
| Syntax    | Description |
| --------- | ----------- |
| Header    | Title       |
| Paragraph | Text        |
SyntaxDescription
HeaderTitle
ParagraphText

Allineamento

Metti : a sinistra, destra o entrambi i lati dei --- nella riga d'intestazione per allineare.

Markdown
Output renderizzato
| Align Left | Align Center | Align Right |
| :--- | :---: | ---: |
| This | This | This |
| column | column | column |
| will | will | will |
| align | align | align |
| left | center | right |
SinistraCentroDestra
ThisThisThis
columncolumncolumn
willwillwill
alignalignalign
leftcenterright