π Markdown table of contents generator
gotoc
is a tool made in Go to generate markdown table of contents inside local git repo.
Links generated refers to Github anchors.
go install github.com/axelbellec/gotoc
gotoc -file=README.md
<!-- Table of Contents generated by [gotoc](https://github.com/axelbellec/gotoc) -->
**Table of Contents** (by [`gotoc`](https://github.com/axelbellec/gotoc))
- [gotoc](#gotoc)
- [Install](#install)
- [Usage](#usage)
- [Custom TOC title](#custom-toc-title)
- [Max heading level for TOC entries](#max-heading-level-for-toc-entries)
- [Compute TOC recursively for each `.md` file in directory/sub directories](#compute-toc-recursively-for-each-md-file-in-directory-sub-directories)
- [Features](#features)
- [Done](#done)
- [Still in development](#still-in-development)
To specify custom TOC title like **Repo : Table of Contents**
you can pass the argument : -title='<yourtitle>'
.
To remove title from TOC, just use the option -notitle
.
To limit TOC entries to a specified level of headings, use : -depth=3
.
To add a TOC to all markdown files in the current directory and subdirectories just use the option -dir
.
Directory architecture example :
dir1
βββββ dir2
β ββββ example.md
β ββββ noheadings.md
β ββββ dir3
β ββββ example.md
ββββ example.md
And we get :
- Generate TOC a top of file
- Enable custom TOC title editing
- Limit TOC entries
- Adding TOC to all files in a directory/sub directories
- Update an existing TOC in Markdown file
- Handle multiple files input