mdtocs is a Markdown table of contents generator.
This project was inspired by the blog post “Markdown Table of Contents Generator”.
Install
npm:
npm install mdtocs
Yarn:
yarn add mdtocs
<script src="https://unpkg.com/mdtocs@latest/umd/mdtocs.min.js"></script>
<script>
window.mdtocs.mdtocs(/* string */);
</script>
Usage
const { mdtocs } = require('mdtocs');
mdtocs('# Hello, World!');
Output:
- [Hello, World!](#hello-world)
See README for more details.