russross / blackfriday

Blackfriday: a markdown processor for Go
Other
5.45k stars 601 forks source link

Add the ability to extract a MarkDown-formatted ToC #201

Open TomOnTime opened 9 years ago

TomOnTime commented 9 years ago

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

qiansen1386 commented 8 years ago

Many markdown tools support following clause. Is it possible for us to add a support for that with an extension?

[TOC]
chaiko commented 8 years ago

+1 for supporting [TOC]

fofen commented 7 years ago

+1 for supporting [TOC]