Mdformat plugin to generate table of contents
Low maintenance activity. Last release 14 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install mdformat-tocmdformat-toc
Mdformat plugin to generate a table of contents
Table of Contents generated with mdformat-toc
Description
Mdformat-toc is an mdformat plugin that adds mdformat the capability to auto-generate a table of contents (ToC). The ToC is generated in a user-specified location in the Markdown file.
Mdformat-toc, by default, creates an HTML anchor for each heading listed in the ToC. ToC links should therefore be compatible with any well-behaved Markdown renderer (including GitLab's renderer).
HTML anchor generation can be disabled, in which case a user should configure a slug function that is compatible with the Markdown renderer used (GitHub and GitLab slug functions are currently supported).
Install
pip install mdformat-toc
Usage
Add the following line to your Markdown file. A ToC will be generated in the location indicated by it.
<!-- mdformat-toc start -->
After adding the indicator line, simply run
mdformat <filename>
and mdformat will generate a ToC.