Markdown-Syntax-Guide

Wichtige Syntax für formatierte Dokumente

Überblick

Markdown ist eine leichtgewichtige Auszeichnungssprache für formatierte Klartext-Dokumente. Seit 2004 (John Gruber) eine der weltweit beliebtesten Auszeichnungssprachen.

Anders als bei WYSIWYG-Editoren wie Word formatierst du in Markdown per Syntax. Du markierst im Text, welche Wörter und Phrasen anders dargestellt werden sollen.

Überschriften

Überschriften erzeugst du mit # vor einem Wort oder einer Phrase. Die Anzahl der # entspricht der Ebene (z. B. ### für Ebene 3).

Markdown
HTML
Gerenderte Ausgabe
# 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

Absätze

Absätze entstehen durch Leerzeilen zwischen Textzeilen.

Markdown
HTML
Gerenderte Ausgabe
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.

Zeilenumbrüche

Für einen Zeilenumbruch die Zeile mit zwei oder mehr Leerzeichen beenden, dann Enter.

Markdown
HTML
Gerenderte Ausgabe
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.

Hervorhebung

Hervorhebung durch Fett oder Kursiv.

Fett

Mit ** oder __ vor und nach einem Wort oder einer Phrase.

Markdown
HTML
Gerenderte Ausgabe
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.

Kursiv

Mit * oder _ vor und nach einem Wort oder einer Phrase.

Markdown
HTML
Gerenderte Ausgabe
The *cat* meows.
The <em>cat</em> meows.

The cat meows.

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

The cat meows.

Fett und Kursiv

Mit *** oder ___ vor und nach einem Wort oder einer Phrase.

Markdown
HTML
Gerenderte Ausgabe
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.

Blockzitate

Blockzitat: > vor einen Absatz setzen.

Markdown
HTML
Gerenderte Ausgabe
> 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.

Verschachtelte Blockzitate

Verschachteln mit >> vor dem Absatz.

Markdown
Gerenderte Ausgabe
> 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.

Listen

Geordnete und ungeordnete Listen möglich.

Geordnete Listen

Zahlen mit Punkt vor jeder Zeile. Die Liste sollte mit 1 beginnen.

Markdown
HTML
Gerenderte Ausgabe
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

Ungeordnete Listen

Zeilen mit -, * oder + beginnen.

Markdown
HTML
Gerenderte Ausgabe
- 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

Code

Wort oder Phrase in Backticks (`) setzen.

Markdown
HTML
Gerenderte Ausgabe
At the command prompt, type `nano`.
At the command prompt, type <code>nano</code>.

At the command prompt, type nano.

Codeblöcke

Jede Zeile mindestens vier Leerzeichen oder ein Tab einrücken, oder ``` vor und nach dem Block.

Markdown
Gerenderte Ausgabe
```
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}
```
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}

Trennlinien

Drei oder mehr ***, --- oder ___ in einer eigenen Zeile.

Markdown
HTML
Gerenderte Ausgabe
***
<hr>

---
<hr>

___
<hr>

Bilder

! gefolgt von [Alt-Text] und (URL bzw. Pfad). Optional Titel in Anführungszeichen.

Markdown
HTML
Gerenderte Ausgabe
![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 vor Zeichen, die sonst als Formatierung gelten, um sie literal zu nutzen.

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

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

Escapbare Zeichen

Backslash zum Escapen z. B. von:

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

Tabellen

Mit --- die Kopfzeile pro Spalte erzeugen, mit | Spalten trennen.

Markdown
Gerenderte Ausgabe
| Syntax    | Description |
| --------- | ----------- |
| Header    | Title       |
| Paragraph | Text        |
SyntaxDescription
HeaderTitle
ParagraphText

Ausrichtung

Mit : links, rechts oder beidseitig der --- in der Kopfzeile ausrichten.

Markdown
Gerenderte Ausgabe
| Align Left | Align Center | Align Right |
| :--- | :---: | ---: |
| This | This | This |
| column | column | column |
| will | will | will |
| align | align | align |
| left | center | right |
LinksMitteRechts
ThisThisThis
columncolumncolumn
willwillwill
alignalignalign
leftcenterright