Markdown Features

Lists

Task

- [ ] Bread
- [ ] Milk
- [x] Butter

Ordered

1. Apple
1. Banana
1. Strawberry
  1. Apple
  2. Banana
  3. Strawberry

Unordered

- Apple
  - A
    - Z
      - Y
  - B
- Banana
  - C
    - Y
  - D
- Strawberry
  - E
    - X
  - F

Inline Markdown

- **bold**
- _italics_
- [link]#
- <small>small</small>
- <kbd>kbd</kbd>
- <sub>sub</sub>
- <sup>sup</sup>
- <mark>mark</mark>
- ~strikethrough~
- `code`
All Combinations

2 modifiers

  • bold italics
  • bold link
  • bold small
  • bold kbd
  • bold sub
  • bold sup
  • bold mark
  • bold strikethrough
  • bold code
  • italics link
  • italics small
  • italics kbd
  • italics sub
  • italics sup
  • italics mark
  • italics strikethrough
  • italics code
  • link small
  • link kbd
  • link sub
  • link sup
  • link mark
  • link strikethrough
  • link code
  • small kbd
  • small sub
  • small sup
  • small mark
  • small strikethrough
  • small code
  • kbd sub
  • kbd sup
  • kbd mark
  • kbd strikethrough
  • kbd code
  • sub sup
  • sub mark
  • sub strikethrough
  • sub code
  • sup mark
  • sup strikethrough
  • sup code
  • mark strikethrough
  • mark code
  • strikethrough code

3 modifiers

4 modifiers

5 modifiers

6 modifiers

7 modifiers

8 modifiers

9 modifiers

10 modifiers

Headings

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

H1

H2

H3

H4

H5
H6

Table

|                | get(i)                 | insert(i)               | remove(i)              | append(Vec(m))    | split_off(i)           | range           | append       |
|----------------|------------------------|-------------------------|------------------------|-------------------|------------------------|-----------------|--------------|
| [`Vec`]        | *O*(1)                 | *O*(*n*-*i*)*           | *O*(*n*-*i*)           | *O*(*m*)*         | *O*(*n*-*i*)           | N/A             | N/A          |
| [`VecDeque`]   | *O*(1)                 | *O*(min(*i*, *n*-*i*))* | *O*(min(*i*, *n*-*i*)) | *O*(*m*)*         | *O*(min(*i*, *n*-*i*)) | N/A             | N/A          |
| [`LinkedList`] | *O*(min(*i*, *n*-*i*)) | *O*(min(*i*, *n*-*i*))  | *O*(min(*i*, *n*-*i*)) | *O*(1)            | *O*(min(*i*, *n*-*i*)) | N/A             | N/A          |
| [`HashMap`]    | *O*(1)~                | *O*(1)~*                | *O*(1)~                | N/A               | N/A                    | N/A             | N/A          |
| [`BTreeMap`]   | *O*(log(*n*))          | *O*(log(*n*))           | *O*(log(*n*))          | N/A               | N/A                    | *O*(log(*n*))   | *O*(*n*+*m*) |
get(i)insert(i)remove(i)append(Vec(m))split_off(i)rangeappend
[Vec]O(1)O(n-i)*O(n-i)O(m)*O(n-i)N/AN/A
[VecDeque]O(1)O(min(i, n-i))*O(min(i, n-i))O(m)*O(min(i, n-i))N/AN/A
[LinkedList]O(min(i, n-i))O(min(i, n-i))O(min(i, n-i))O(1)O(min(i, n-i))N/AN/A
[HashMap]O(1)~O(1)~*O(1)~N/AN/AN/AN/A
[BTreeMap]O(log(n))O(log(n))O(log(n))N/AN/AO(log(n))O(n+m)

Admonition

> "This is a blockquote"
> 
> -- Einstein, 1984

“This is a blockquote”

– Einstein, 1984

<note>
  This is a note
</note>
This is a note
<tip>
  This is a tip
</tip>
This is a tip
<important>
  This is a important
</important>
This is a important
<caution>
  This is a caution
</caution>
This is a caution
<warning>
  This is a warning
</warning>
This is a warning

Code Blocks

Plain

```rust
fn main() {
    for i in 1..=5 {
        println!("{i} squared is {}", i * i);
    }
}
```

Renders as:

fn main() {
    for i in 1..=5 {
        println!("{i} squared is {}", i * i);
    }
}

Line Numbers

Use linenos attribute to enable line numbers:

```rust,linenos
fn main() {
    for i in 1..=5 {
        println!("{i} squared is {}", i * i);
    }
}
```

Renders as:

1fn main() {
2 for i in 1..=5 {
3 println!("{i} squared is {}", i * i);
4 }
5}

Start at a specific line

You can specify linenostart to start at a specific line number:

```rust,linenos,linenostart=20
fn main() {
    for i in 1..=5 {
        println!("{i} squared is {}", i * i);
    }
}
```

Renders as:

20fn main() {
21 for i in 1..=5 {
22 println!("{i} squared is {}", i * i);
23 }
24}

Highlight lines

Make certain lines stand out.

```rust,hl_lines=1 3-5
fn main() {
    for i in 1..=5 {
        println!("{i} squared is {}", i * i);
    }
}
```

Renders as:

fn main() {
    for i in 1..=5 {
        println!("{i} squared is {}", i * i);
    }
}

Hide lines

Hide certain lines.

```rust,hide_lines=2
fn main() {
    // Secret!
    for i in 1..=5 {
        println!("{i} squared is {}", i * i);
    }
}
```

Renders as:

fn main() {
    for i in 1..=5 {
        println!("{i} squared is {}", i * i);
    }
}

Named code blocks

You can also name code blocks.

```rust,name=mod.rs
fn main() {
    for i in 1..=5 {
        println!("{i} squared is {}", i * i);
    }
}
```

Renders as:

fn main() {
    for i in 1..=5 {
        println!("{i} squared is {}", i * i);
    }
}

Everything at once

All the attributes compose together.

```rust,name=mod.rs,hide_lines=2,hl_lines = 3-5,linenos,linenostart = 10
fn main() {
    // This is a comment
    for i in 1..=5 {
        println!("{i} squared is {}", i * i);
    }
}
```

Renders as:

1fn main() {
3 for i in 1..=5 {
4 println!("{i} squared is {}", i * i);
5 }
6}

The exact syntax is described in more detail in the Zola documentation.