package
[](https://circleci.com/gh/sosukesuzuki/gen-toc) [](https://badge.fury.io/js/gen-toc) [
- [Heading2-2](#Heading2-2)
## Heading2-1
## Heading2-2If you use gen-toc with --write option, gen-toc writes to a file.
$ gen-toc --write ./test.md
test.md
Donegen-toc format a markdown with Prettier on default. If you don't want gen-toc to format, you can add --noformat option.
If you don't want to use a heading of ## Table of Contents, you can use a comment of <-- Table of Contents --> instead of a heading.
$ cat test.md
# Heading1
<!-- Table of Contents -->
## Heading2-1
## Heading2-2
$ gen-toc test.md
# Heading1
<!-- Table of Contents -->
- [Heading2-1](#Heading2-1)
- [Heading2-2](#Heading2-2)
## Heading2-1
## Heading2-2MIT
Estimated unpacked size across 36 packages.
12.4 MB
Includes dependencies.
7 direct · 6 outdated
^7.1.0
11.0.5
^1.18.2
3.10.1
^2.20.0
15.1.0
^6.0.3
11.0.0
^1.1.0
1.1.0
^1.0.4
4.0.0
^6.0.4
11.0.0