Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where is the generated toc #184

Open
Legends opened this issue Apr 26, 2023 · 1 comment
Open

Where is the generated toc #184

Legends opened this issue Apr 26, 2023 · 1 comment

Comments

@Legends
Copy link

Legends commented Apr 26, 2023

Tried:

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

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

@gregdan3
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants