Headings
Start a line with one to six # characters followed by a space.
More hashes mean a smaller, lower-level heading.
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6 Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Use one # heading per document and don't skip levels. Screen readers
and generated tables of contents rely on that outline.
Inline code
Wrap commands, file names or short snippets in single backticks to show them in a monospace font.
Run `npm install` before you start.
Show a backtick: `` `code` `` Run npm install before you start.
Show a backtick: `code`
If your snippet contains a backtick, wrap it in double backticks and add a space on each side.
Code blocks
Put three backticks on the line before and after a multi-line snippet. Add a language name after the opening backticks to turn on syntax highlighting.
With a language
```js
function greet(name) {
return `Hello, ${name}!`;
}
``` function greet(name) {
return `Hello, ${name}!`;
}Terminal commands
```bash
git checkout -b feature/docs
npm run build
``` git checkout -b feature/docs
npm run build
Common language names: js, ts,
python, bash, json,
yaml, diff. To show a fence inside a fence, wrap the
outer block in four backticks.
Lists
Start lines with - for bullets or 1. for numbers.
Indent by two spaces to nest a list.
Bullet list
- Apples
- Oranges
- Blood orange
- Navel
- Pears - Apples
- Oranges
- Blood orange
- Navel
- Pears
Numbered list
1. Clone the repo
2. Install dependencies
3. Start the dev server - Clone the repo
- Install dependencies
- Start the dev server
Task list
- [x] Write the draft
- [ ] Review it
- [ ] Publish - Write the draft
- Review it
- Publish
Leave a blank line between a paragraph and a list, or some renderers treat the list as part of the paragraph.
Quotes
Start a line with > to quote it. A lone > keeps
paragraphs in the same quote, and >> nests one quote inside another.
> Simplicity is prerequisite for reliability.
>
> — Edsger W. Dijkstra Simplicity is prerequisite for reliability.
— Edsger W. Dijkstra
Nested quote
> First level
>
>> Nested reply First level
Nested reply
Tables
Separate columns with pipes | and put a row of dashes under the header.
Colons in that row set the alignment: :-- left, :-:
center, --: right.
| Command | Purpose | Runs |
| :------ | :----------: | ---: |
| `dev` | Local server | 1 |
| `build` | Production | 2 | | Command | Purpose | Runs |
|---|---|---|
dev | Local server | 1 |
build | Production | 2 |
The pipes don't have to line up. Aligning them only makes the source easier to read. To use a
literal pipe inside a cell, write \|.
Cheat sheet
Everything on this page at a glance.
| Element | Syntax |
|---|---|
| Heading | ## Title |
| Inline code | `code` |
| Code block | ```lang … ``` |
| Bullet list | - item |
| Numbered list | 1. item |
| Task list | - [ ] todo |
| Quote | > text |
| Table | | a | b | |