![]()
continuous-integration/drone/push Build is passing
Details
|
2 months ago | |
---|---|---|
.dockerfiles | 2 months ago | |
.github/workflows | 2 years ago | |
.vscode | 2 months ago | |
cmd/toc | 2 months ago | |
testdata | 2 months ago | |
tools | 2 months ago | |
.drone.yml | 2 months ago | |
.gitignore | 2 months ago | |
.goreleaser.yml | 2 months ago | |
CHANGELOG.md | 2 years ago | |
Dockerfile | 2 months ago | |
LICENSE | 2 months ago | |
LICENSE.old | 2 months ago | |
Makefile | 2 months ago | |
README.md | 2 months ago | |
go.mod | 2 months ago | |
go.sum | 2 months ago | |
options.go | 2 months ago | |
preflight.sh | 2 months ago | |
toc.go | 2 months ago | |
version.go | 2 months ago |
README.md
toc - 🚩 Zero configuration table of content generator for Markdown files.
toc
is a command-line tool and a Go library for generating table of contents form Markdown files.
Quick Start
go install go.mills.io/toc/cmd/toc@latest
Add <!--toc-->
to your markdown to the place where you want to add Table of Contents. That's it.
Give the markdown file as an input by providing it as the first argument.
toc path/to/markdown.md
Create numbered list instead of bulleted list.
toc -l
Write result in-place to the file instead of standard output.
toc -w
Skip the first n
number of headers via -s
, --skip
flags.
toc -s 2
Set the number of maximum heading level to be included with -d
, --depth
flags.
Set maximum heading level to 3 (h3)
toc -d 3
Features
- Zero configuration
- Write in-place or to stdout
- Specify depth level
- Skip headings
- Use bulleted or numbered lists
Installation
Download the binaries from go.mills.io/prologic/toc:
go install go.mills.io/toc/cmd/toc@latest
Or build from source manually:
git clone https://git.mills.io/prologic/toc
cd toc
make install
Licence
toc
is licensed under the terms of the MIT License and was originally forked from @ycd's ycd/toc also licensed under an MIT License.