https://github.com/hi5/InsertTOCintoMD/
GitHub automatically inserts anchors into your Markdown files when browsing a GH repository. This AutoHotkey script inserts a table of contents into your Markdown file - a table of contents can be updated by simply calling the script again.
Place a marker in the document where you would like the table of contents to appear. Then, a nested list of all the headers in the document will replace the marker. The marker defaults to <!-- [toc] --> [...] <!-- [/toc] --> so the following document:
Code: Select all
<!-- [toc] -->
...
<!-- [/toc] -->
# Header 1
## Header 2
Code: Select all
<!-- [toc] -->
1. [Header 1](#header1)
* [Header 2](#header2)
<!-- [/toc] -->
# Header 1
## Header 2