Home Cheat Sheets Markdown

Markdown Cheat Sheets

Markdown comprehensive cheat sheet

Getting Started

Basic Markdown Example

# Heading 1

This is a paragraph.

- List item 1
- List item 2

**Bold text** and *italic text*.

Markdown Resources

Markdown Guide https://www.markdownguide.org/
GitHub Flavored Markdown https://github.github.com/gfm/
CommonMark Spec https://spec.commonmark.org/

Headings

Headings

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

Heading Levels

#
H1
##
H2
###
H3
####
H4
#####
H5
######
H6

Text Formatting

Text Styles

**bold**
Bold text
*italic*
Italic text
~~strikethrough~~
Strikethrough
`inline code`
Inline code
***bold italic***
Bold and italic

Text Formatting Example

This is **bold**, *italic*, ~~strikethrough~~, and `inline code`.

Links

Links

[Inline Link](https://www.example.com)

[Reference Link][1]

[1]: https://www.example.com

Link Types

[text](url)
Inline link
[text][id]
Reference link
<https://www.example.com>
Autolink

Images

Images

![Alt text](https://www.example.com/image.png)

![Reference Image][img1]

[img1]: https://www.example.com/image.png

Image Syntax

![alt](url)
Inline image
![alt][id]
Reference image
![alt](url "Title")
Image with title attribute

Lists

Unordered List

- Item 1
- Item 2
  - Subitem 2.1
  - Subitem 2.2

Ordered List

1. First
2. Second
3. Third

Task List

- [x] Task 1
- [ ] Task 2

Blockquotes

Blockquotes

> This is a blockquote.
>
> - You can nest lists
> - And other Markdown elements

Blockquote Tips

> Nested
Use > for nested blockquotes
Mix
Blockquotes can contain lists, code, etc.

Code

Inline Code

Use `code` for inline code.

Code Block

```python
def hello():
    print("Hello, Markdown!")
```

Code Block Tips

Indent 4 spaces
Alternative to fenced code block
Syntax highlight
Use language after ```

Tables

Tables

| Syntax | Description |
|--------|-------------|
| Header | Title       |
| Cell   | Cell        |

Table Tips

:---
Left align
:---:
Center align
---:
Right align

Horizontal Rules

Horizontal Rule

---

***

___

Horizontal Rule Tips

---
Three or more dashes
***
Three or more asterisks
___
Three or more underscores

Escaping Characters

Escaping Markdown

\*This text is not italic*

Escapable Characters

\*
Asterisk
\_
Underscore
\`
Backtick
\[
Left bracket
\]
Right bracket

Footnotes & References

Footnotes

Here is a footnote reference,[^1]

[^1]: Here is the footnote.

Reference Links

[id]: url
Reference-style link definition
[text][id]
Reference-style link usage

Emoji

Emoji

I :heart: Markdown! :smile:

Popular Emoji Codes

:smile:
😄
:thumbsup:
👍
:rocket:
🚀
:fire:
🔥

HTML in Markdown

Inline HTML

<span style="color: red;">Red text</span>

HTML Elements in Markdown

<br>
Line break
<sup>
Superscript
<sub>
Subscript
<kbd>
Keyboard input

Math/LaTeX

MathJax/LaTeX

Inline math: $E=mc^2$

Block math:

$$
\int_0^\infty e^{-x} dx = 1
$$

Math Syntax

$...$
Inline math
$$...$$
Block math
\frac{a}{b}
Fraction
\sum_{i=1}^n i
Sum

Best Practices & Tips

Best Practices

Use whitespace
Separate blocks for readability
Preview
Always preview before publishing
Consistent style
Stick to one style for headings/lists
Escape special chars
Use backslash for special characters

Further Reading

Markdown Guide https://www.markdownguide.org/
CommonMark Spec https://spec.commonmark.org/
GitHub Flavored Markdown https://github.github.com/gfm/