Generate or insert a table of contents for a Markdown file.
Project description
markdown-toc-cli
Insert a table-of-contents into a Markdown file.
Heavily inspired from this project: https://github.com/hukkin/mdformat-toc
I'd recommend using that unless you don't want to run the built-in mdformat
formatting. Then this tool might be suitable for a standalone version.
Installation
pip install markdown-toc-cli
Usage
Add a comment like this to the Markdown file:
<!-- markdown-toc-cli --prefix='- ' --indentation=' ' --minlevel=1 --maxlevel=6 -->
All arguments are optional, with the defaults values shown above (compatible with GitHub flavored markdown).
Then run the tool:
markdown-toc-cli README.md
pre-commit Hook
Example usage of this as a pre-commit hook:
- repo: https://github.com/noahp/markdown-toc-cli
rev: 0.1.1
hooks:
- id: markdown-toc-cli
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
markdown_toc_cli-0.1.1.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for markdown_toc_cli-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d37da5b66e913e2f8c3b0e2945d22a67b69ade9d640c86f2cb021bdc8cc43470 |
|
MD5 | 1d6ba2990d9084ed02d00481cf64953f |
|
BLAKE2b-256 | 09c0839855ed394909c5744a02eac9f16b6a54f039d5faa338f63243f1b71385 |