Walks a Markdown document and emits a nested table of contents.
I kept rewriting the same thirty lines in every project, so I pulled them out.
pip install md-tocfrom md_toc import mdToc
result = mdToc("example")
print(result)- No runtime dependencies outside the standard library.
- Tested on Python 3.9 and newer.
MIT