Skip to main content

GitHub PyPI version PyPI pyversions GitHub Workflow Status

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

Metadata

Release files for markdown-toc-cli 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for markdown-toc-cli 0.1.1
File Size Uploaded
markdown_toc_cli-0.1.1.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for markdown-toc-cli 0.1.1
File Interpreter ABI Platform
markdown_toc_cli-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.6 kB

Release files / markdown_toc_cli-0.1.1.tar.gz

Download URL markdown_toc_cli-0.1.1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
53bbf5420c80449c5c6ab0a59b17b7c7c5398d9a6f0cbc9f14901f4edb496c39
BLAKE2b-256 checksum
How to use checksums
a68f6d7681fd62f76bf9d32caf329c627f23e30b88ba1c4aa7fe61fc5c86b70d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/21.8.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

Release files / markdown_toc_cli-0.1.1-py3-none-any.whl

Download URL markdown_toc_cli-0.1.1-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d37da5b66e913e2f8c3b0e2945d22a67b69ade9d640c86f2cb021bdc8cc43470
BLAKE2b-256 checksum
How to use checksums
09c0839855ed394909c5744a02eac9f16b6a54f039d5faa338f63243f1b71385
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/21.8.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page