gotoc

command module
v0.0.0-...-458c609 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2016 License: MIT Imports: 9 Imported by: 0

README ΒΆ

License

gotoc

πŸ“„ Markdown table of contents generator

logo_godoc

gotoc is a tool made in Go to generate markdown table of contents inside local git repo.
Links generated refers to Github anchors.

Install

go install github.com/axelbellec/gotoc

Usage

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)

Custom TOC title

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.

Max heading level for TOC entries

To limit TOC entries to a specified level of headings, use : -depth=3.

Compute TOC recursively for each .md file in directory/subdirectories

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 :

logo_godoc

Features

Done
  • Generate TOC a top of file
  • Enable custom TOC title editing
  • Limit TOC entries
  • Adding TOC to all files in a directory/sub directories
Still in development
  • Update an existing TOC in Markdown file
  • Handle multiple files input

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL