DISCLAIMER: This script doesn't handle correctly headings that contains other tags. It is made to work only on plain headings that's created by a rich text or markdown editor.
Extracts relevant table of contents data out of your HTML markup and add permalinks to your markup's headings.
Takes your HTML markup, outputs a string in JSON format of the relevant data (level, content and slug) and inserts permalinks to the markup's headings.
Please contact me at at@aranggitoar.com.