MarkDown doesn't have a native "insert ToC here" directive. Some systems have added one. Others, such as Gitlab, requires the ToC to be manually inserted. I've been looking for a tool that would generate the ToC so that I can "sed" it into my MarkDown files. Sadly I didn't find any, but I did find blackfriday which has 99% of the code required.
I hope you are open to pull requests that add new features. I'll be sending you two (one for blackfriday, one for blackfriday-tool) which add a "-mdtoc" flag that simply outputs the ToC. It isn't ideal (ideal would be that it inserts the ToC into the Markdown automatically). However this is a good start and I'm sure many people will appreciate it.
MarkDown doesn't have a native "insert ToC here" directive. Some systems have added one. Others, such as Gitlab, requires the ToC to be manually inserted. I've been looking for a tool that would generate the ToC so that I can "sed" it into my MarkDown files. Sadly I didn't find any, but I did find blackfriday which has 99% of the code required.
I hope you are open to pull requests that add new features. I'll be sending you two (one for blackfriday, one for blackfriday-tool) which add a "-mdtoc" flag that simply outputs the ToC. It isn't ideal (ideal would be that it inserts the ToC into the Markdown automatically). However this is a good start and I'm sure many people will appreciate it.
Thanks! Tom