🚩 Zero configuration table of content generator for Markdown files.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Go to file
James Mills 1d525a348a
continuous-integration/drone/push Build is passing Details
Fix Drone CI config (again)
2 months ago
.dockerfiles Big major project refactor 2 months ago
.github/workflows release: update workflow 2 years ago
.vscode Big major project refactor 2 months ago
cmd/toc Fix errors to go to stderr 2 months ago
testdata Remove some cruft 2 months ago
tools Add goreleaser config 2 months ago
.drone.yml Fix Drone CI config (again) 2 months ago
.gitignore Add goreleaser config 2 months ago
.goreleaser.yml Add goreleaser config 2 months ago
CHANGELOG.md doc: add changelog.md 2 years ago
Dockerfile Fix Docker image 2 months ago
LICENSE Big major project refactor 2 months ago
LICENSE.old Big major project refactor 2 months ago
Makefile Fix build target 2 months ago
README.md Big major project refactor 2 months ago
go.mod Big major project refactor 2 months ago
go.sum Big major project refactor 2 months ago
options.go Big major project refactor 2 months ago
preflight.sh Big major project refactor 2 months ago
toc.go Fix errors to go to stderr 2 months ago
version.go Big major project refactor 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.

Build Status

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.