Przewodnik składni Markdown

Niezbędna składnia do formatowania dokumentów

Przegląd

Markdown to lekki język znaczników do dodawania formatowania do zwykłego tekstu. Stworzony przez Johna Grubera w 2004 r., jest jednym z najpopularniejszych języków znaczników na świecie.

Użycie Markdown różni się od edytora WYSIWYG. W Wordzie klikanie formatuje tekst od razu; w Markdown dodajesz składnię do tekstu, by wskazać, co ma wyglądać inaczej.

Nagłówki

Aby utworzyć nagłówek, dodaj # przed słowem lub frazą. Liczba # odpowiada poziomowi (np. ### = poziom 3).

Markdown
HTML
Wynik renderowania
# 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

Akapity

Aby utworzyć akapity, oddziel linie tekstu pustą linią.

Markdown
HTML
Wynik renderowania
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.

Nowe linie

Aby złamać linię, zakończ ją dwiema spacjami i naciśnij Enter.

Markdown
HTML
Wynik renderowania
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.

Emfaza

Możesz dodać emfazę pogrubieniem lub kursywą.

Pogrubienie

Pogrubienie: ** lub __ przed i po słowie lub frazie.

Markdown
HTML
Wynik renderowania
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.

Kursywa

Kursywa: * lub _ przed i po słowie lub frazie.

Markdown
HTML
Wynik renderowania
The *cat* meows.
The <em>cat</em> meows.

The cat meows.

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

The cat meows.

Pogrubienie i kursywa

Jednocześnie: *** lub ___ przed i po tekście.

Markdown
HTML
Wynik renderowania
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.

Cytaty

Cytat: dodaj > przed akapitem.

Markdown
HTML
Wynik renderowania
> 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.

Zagnieżdżone cytaty

Cytaty można zagnieżdżać. Dodaj >> przed akapitem do zagnieżdżenia.

Markdown
Wynik renderowania
> 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.

Listy

Możesz tworzyć listy numerowane i punktowane.

Listy numerowane

Lista numerowana: numery z kropką na początku każdej linii, zacznij od 1.

Markdown
HTML
Wynik renderowania
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

Listy punktowane

Lista punktowana: - lub * lub + na początku każdej linii.

Markdown
HTML
Wynik renderowania
- 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

Kod

Aby oznaczyć tekst jako kod, umieść go w backtickach `.

Markdown
HTML
Wynik renderowania
At the command prompt, type `nano`.
At the command prompt, type <code>nano</code>.

At the command prompt, type nano.

Bloki kodu

Blok kodu: wcięcie co najmniej 4 spacjami lub tabem w każdej linii, lub ``` przed i po bloku.

Markdown
Wynik renderowania
```
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}
```
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}

Linie poziome

Linia pozioma: *** lub --- lub ___ w osobnej linii.

Markdown
HTML
Wynik renderowania
***
<hr>

---
<hr>

___
<hr>

Obrazy

Obraz: ! potem [tekst alt](URL obrazu), opcjonalnie tytuł w cudzysłowie.

Markdown
HTML
Wynik renderowania
![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

Znaki specjalne

Aby wyświetlić znak używany do formatowania, dodaj \ przed nim.

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

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

Znaki do escapowania

Możesz użyć backslasha do escapowania:

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

Tabele

Tabela: --- dla nagłówków kolumn, | do rozdzielania kolumn.

Markdown
Wynik renderowania
| Syntax    | Description |
| --------- | ----------- |
| Header    | Title       |
| Paragraph | Text        |
SyntaxDescription
HeaderTitle
ParagraphText

Wyrównanie

Dodaj : po lewej, prawej lub obu stronach --- w wierszu nagłówka, by wyrównać kolumny.

Markdown
Wynik renderowania
| Align Left | Align Center | Align Right |
| :--- | :---: | ---: |
| This | This | This |
| column | column | column |
| will | will | will |
| align | align | align |
| left | center | right |
Do lewejDo środkaDo prawej
ThisThisThis
columncolumncolumn
willwillwill
alignalignalign
leftcenterright