markdown-toc icon indicating copy to clipboard operation
markdown-toc copied to clipboard

Where is the generated toc

Open Legends opened this issue 2 years ago • 1 comments

Tried:

 "scripts": {
    "toc": "markdown-toc -i readme.md"
  }

and npm run toc ... it seems like it does nothing...

Legends avatar Apr 26 '23 09:04 Legends

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.json and readme.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.

gregdan3 avatar Sep 17 '23 23:09 gregdan3