For those who uses github and markdown, I have created a simple workflow to automatically create the Table Of Contents for the markdown files.
The github website is: https://github.com/bhishanpdl/Alfred_MARKDOWN_TOC
We can also find this package in packal.