Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kevingimbel/mktoc

🦀 Markdown Table of Content generator
https://github.com/kevingimbel/mktoc

cli command-line command-line-tool generator markdown rust rust-library table-of-contents toc

Last synced: 2 months ago
JSON representation

🦀 Markdown Table of Content generator

Awesome Lists containing this project

README

        

# `mktoc`

![](assets/github-header.png)

Graphic design is my passion ✨

![](https://github.com/kevingimbel/mktoc/workflows/Clippy%20check/badge.svg)
![](https://github.com/kevingimbel/mktoc/workflows/Test/badge.svg)
![Coverage](assets/coverage/flat.svg)

# Table of Contents

- [About](#about)
- [Installation](#installation)
- [Cargo](#cargo)
- [Binary](#binary)
- [Usage](#usage)
- [Update Markdown file](#update-markdown-file)
- [Inline config](#inline-config)
- [`min_depth`](#min_depth)
- [`max_depth`](#max_depth)
- [`wrap_in_details`](#wrap_in_details)
- [Command line](#command-line)
- [Environment configuration](#environment-configuration)
- [Auto-run with VSCode](#auto-run-with-vscode)
- [Performance](#performance)
- [Contributing](#contributing)
- [Where to start?](#where-to-start)
- [Tooling](#tooling)
- [Install dev build](#install-dev-build)
- [License](#license)

## About
[⬆️ Back to Top](#table-of-contents)

`mktoc` parses markdown files and generates a Table Of Content linking all headlines up to heading level 6 deep, or as specified by command line arguments, environment variables, or inline JSON config (see [Usage](#usage)).

## Installation
[⬆️ Back to Top](#table-of-contents)

`mktoc` can be installed using Cargo, the Rust package manager.

### Cargo

**Installation**
```sh
$ cargo install mktoc
```

**Update**
```sh
$ cargo install --force mktoc
```

### Binary

Binaries for Linux and MacOS can be downloaded from the [release page](https://github.com/KevinGimbel/mktoc/releases/latest).

Windows Binaries are not yet build automatically, see [#7](https://github.com/KevinGimbel/mktoc/issues/7).

## Usage

### Update Markdown file
[⬆️ Back to Top](#table-of-contents)

Add the following HTML comment into the Markdown file where the Table of Contents should be rendered.

```html

```

Everything between those comments will be replaced!

#### Inline config
[⬆️ Back to Top](#table-of-contents)

Starting with version 3.0.0 it's possible to set values in-line which is great when collaborating with teams who may have individual settings.

```html