markdown-toc
markdown-toc copied to clipboard
Where is the generated toc
Tried:
"scripts": {
"toc": "markdown-toc -i readme.md"
}
and
npm run toc
... it seems like it does nothing...
With the following readme.md:
---
title: Foo
---
<!-- toc -->
# Heading
## Subheading
And package.json:
{
"dependencies": {
"markdown-toc": "^1.2.0"
},
"scripts": {
"toc": "markdown-toc -i readme.md"
}
}
And running npm run toc, readme.md is changed to:
---
title: Foo
---
<!-- toc -->
- [Heading](#heading)
* [Subheading](#subheading)
<!-- tocstop -->
# Heading
## Subheading
Things to check:
- Do you have
<!-- toc -->or the pair of<!-- tocstart --> <!-- tocstop -->in your file somewhere? - Does your document contain any headings to be added to the TOC?
- Is your file named exactly
readme.md? - Are you executing in the same directory as both the
package.jsonandreadme.md?
markdown-toc does not notify when or if it has done something to your document; it also doesn't really need to, but that would a nice-to-have.