Skip to content

A table of contents generator for markdown documents written in Rust.

License

Notifications You must be signed in to change notification settings

1Git2Clone/taboc

Repository files navigation

Taboc

Build IconDocs IconVersion IconLicense Icon

A table of contents generator for markdown documents.

Table of contents

Installation

This project is available on crates.io, meaning the installation is as simple as typing:

cargo install taboc

Then you can use the taboc binary in your shell. Make sure to check out the commands with the -h flag.

Features

Generic options

Related flags:

  • --input - The input file (Default: ./README.md).
  • --no-file-update - Use if you want to just print the table of contents without updating the file.
  • --max-depth - The maximum heading depth to search for (Default: 6).
  • --update-existing - Use to update the existing table of contents.

Version Control Systems

Related flags:

  • --allow-dirty - Checks if the [INPUT] file is:

    • not tracked
    • doesn't have staged changes
    • has staged changes
  • --no-vcs - Disables VCS checks (based on the chosen VCS).

Currently supported VCS:

  • Git (default)
  • Hg
  • Pijul
  • Fossil

Note

If you try to use this script without a VCS then it's likely that the VCS checks will fail. That's why you should use the --no-vcs flag to explicitly not check for a VCS.

Memmap

Use the operating system's memory mapping for managing the file directly.

This is space efficient, however it's often slower due to less cache locality and also less safe in the case of multiple writers causing UB.

Refer to memmap2::MmapMut#safety.

About

A table of contents generator for markdown documents written in Rust.

Topics

Resources

License

Stars

Watchers

Forks

Languages