Markdown Cheatsheet

Headings, formatting, links, images, tables & more

Reference
Contents
📝

Headings

# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6

Alternative (for H1 and H2):
Heading 1
=========

Heading 2
---------
✏️

Formatting

*italic*  or  _italic_
**bold**  or  __bold__
***bold italic***
~~strikethrough~~
`inline code`

> Blockquote
>> Nested blockquote

---           horizontal rule
***           horizontal rule

Escaping special characters
\*not italic\*
\# not a heading
📋

Lists

Unordered
- Item 1
- Item 2
  - Nested item
  - Nested item

Ordered
1. First
2. Second
3. Third

Task list (GitHub)
- [x] Completed task
- [ ] Incomplete task
- [ ] Another task

Definition list (some parsers)
Term
: Definition here
💻

Code

Inline code
Use `backticks` for inline code.

Code block (fenced)
```python
def hello():
    print("Hello!")
```

```javascript
const x = 42;
```

Indented code block (4 spaces)
    function hello() {
        return "hi";
    }
📊

Tables

| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Cell 1   | Cell 2   | Cell 3   |
| Cell 4   | Cell 5   | Cell 6   |

Alignment
| Left     | Center   | Right    |
|:---------|:--------:|---------:|
| left     | center   | right    |

Miscellaneous

Emoji (GitHub)
:smile: :rocket: :tada: :+1:

HTML in Markdown
<details>
<summary>Click to expand</summary>
Hidden content here
</details>

Line break
End line with two spaces  (soft break)
Or use <br> tag

Math (GitHub, some parsers)
Inline: $E = mc^2$
Block:
$$
\sum_{i=1}^{n} x_i
$$
🐙

GitHub Flavored

Task lists
- [x] Done
- [ ] Todo

Mentions & References
@username     mention user
#123          issue/PR reference
SHA           commit reference

Alerts (GitHub)
> [!NOTE]
> Information note

> [!WARNING]
> Warning message

> [!TIP]
> Helpful tip

Mermaid diagrams
```mermaid
graph LR
  A --> B --> C
```