DocToc
Generates table of contents for markdown files inside local git
DocToc is a command-line utility that automatically generates and maintains tables of contents inside Markdown documents. It supports Markdown, Markdown Extended, and MDX files and can recursively process complete directory trees. Generated links can match anchor conventions used by GitHub, GitLab, Bitbucket, Node.js, and Ghost. Users can limit heading levels, exclude specific headings, control list formats, and choose where the generated table appears.