markdown-toc

Generate a markdown table of contents from markdown files

brewmacoslinux
Try with needOr install directly
Source

About

Generate a markdown TOC (table of contents) with Remarkable

Commands

markdown-toc

Examples

Generate TOC for a markdown file and display it$ markdown-toc README.md
Generate TOC and save it to a file$ markdown-toc README.md > toc.md
Generate TOC with custom depth levels$ markdown-toc --maxdepth 3 README.md