InsertTOCintoMD - Insert table of contents in Markdown file

Post your working scripts, libraries and tools for AHK v1.1 and older
ahk7
Posts: 591
Joined: 06 Nov 2013, 16:35

InsertTOCintoMD - Insert table of contents in Markdown file

07 Nov 2013, 15:23

AutoHotkey script to add a Table of Contents to a Markdown document.

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
would generate the following output:

Code: Select all

   <!-- [toc] -->
   1. [Header 1](#header1)
       * [Header 2](#header2)
   <!-- [/toc] -->

   # Header 1

   ## Header 2
Further documentation in the script https://github.com/hi5/InsertTOCintoMD/

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 118 guests