summaryrefslogtreecommitdiffstats
path: root/README.md
blob: 1f485039e1cb3724d6b1823659f370b5a94234eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# `mktoc`
> Blazingly fast Table of Content generator

<!-- BEGIN mktoc -->
- [`mktoc`](#`mktoc`)
- [About](#about)
- [Installation](#installation)
  - [Cargo](#cargo)
  - [Binary](#binary)
- [Usage](#usage)
- [mktoc [--write] <FILE>](#mktoc-[--write]-<file>)
- [Performance](#performance)
<!-- END mktoc -->

## About

`mktoc` parses markdown files and generates a Table Of Content linking all headlines up to heading level 6 deep.

## Installation

`mktoc` can be installed using Cargo, the Rust package manager, or by downloading a binary from GitHub.

### Cargo

```sh
$ cargo install mktoc
```

### Binary

Download latest release from [https://github.com/kevingimbel/mktoc/releases](https://github.com/kevingimbel/mktoc/releases) and place it somewhere in your `PATH`, e.g. `/usr/local/bin`.

## Usage

Specify `--write` to overwrite the given file, otherwise the modified content is written to stdout.

```
# mktoc [--write] <FILE>
$ mktoc --write README.md
```

See `mktoc --help` for list of all arguments and flags.

 
## Performance

`mktoc` is blazingly fast. Large files such as the README examples in `tests/files/` render in 0.009s (9ms) on average.