A simple table of contents generator for markdowns written in golang
$ go get github.com/tvastar/toc
The table of contents of this README.md is itself maintaained using this tool.
$ toc $(go env GOPATH)/src/github.com/tvastar/toc/README.md
## Table of Contents
1. [Contents](#contents)
2. [Install](#install)
3. [Usage](#usage)
1. [Output to stdin](#output-to-stdin)
2. [Inplace update](#inplace-update)
3. [Custom heading IDs](#custom)
$ cd $(go env GOPATH)/src/github.com/tvastar/toc
$ toc -o README.md -h Contents README.md
As with regular markdown, a custom heading ID may be specified via {#id}
suffix to the heading line. This is properly parsed and used for headings.
Top level sections are ignored by default