cmark
Automatically generate and add an accurate table of contents to markdown files. See also the GitHub action: https://github.com/frnmst/md-toc-action
A Python wrapper for GitHub's fork of 'cmark', supporting GFM extensions