Cheat Sheet Library

Markdown Cheat Sheet

Plain-text formatting used in READMEs, GitHub, Notion, Obsidian, Discord and docs sites. Extra features marked GFM work on GitHub (GitHub Flavored Markdown).

  • 15 entries
  • 10 sections
  • Updated

15 entries

On this page

Text #

You writeYou get
**bold**bold
*italic* or _italic_italic
***bold italic***bold italic
~~strike~~ (GFM)strike
`code`code
<kbd>Ctrl</kbd>Ctrl
H<sub>2</sub>O, x<sup>2</sup>H2O, x2
\*not italic\**not italic* (backslash escapes)

Headings #

# Heading 1
## Heading 2
### Heading 3
#### Heading 4

Lists #

- Bullet
- Another
  - Nested (indent 2 spaces)

1. First
2. Second
   1. Nested

- [ ] To do          (GFM task list)
- [x] Done
[Link text](https://example.com)
[Link with title](https://example.com "Hover title")
<https://example.com>                     auto-link
[Jump to a section](#lists)               heading anchors: lowercase, spaces → -

![Alt text](assets/images/logo.png)
[![Clickable image](img.png)](https://example.com)

[Reference link][docs]
[docs]: https://docs.example.com

Code #

Inline: `npm install`

```js
console.log("fenced block with syntax highlighting");
```

```diff
- removed line
+ added line
```

Tables (GFM) #

| Left   | Center | Right |
|:-------|:------:|------:|
| a      |   b    |     c |

Write \| to put a pipe inside a cell.

Blocks #

> Blockquote
> > Nested quote

---                         horizontal line

> [!NOTE]                   GitHub alert boxes:
> Useful info.              NOTE, TIP, IMPORTANT, WARNING, CAUTION

<details>
<summary>Click to expand</summary>

Hidden content (leave a blank line after the summary).

</details>

Extras #

FeatureSyntax
Footnote (GFM)Text[^1] … [^1]: The note.
Line breakEnd the line with two spaces or <br>
Comment (hidden)<!-- not shown -->
Emoji (GitHub):rocket:
Math (GitHub)$E = mc^2$ or a $$ … $$ block
Diagram (GitHub)A fenced block with the language mermaid
Front matterYAML between --- lines at the very top (Astro, Jekyll, Obsidian)

Mermaid Example #

flowchart LR
  A[Write] --> B[Commit] --> C[Push]

Tips #

  • Leave a blank line before and after lists, headings, tables and code blocks.
  • VS Code: Ctrl + Shift + V opens a preview, Ctrl + K V opens it side by side.