Generate and insert markdown's table of contents
Branch: master
Clone or download
Latest commit 0a42e93 Jan 28, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config add Makefile Jan 28, 2019
mdtoc update Jan 28, 2019
.gitignore ignore dist Jan 28, 2019
.goreleaser.yml set ldflaggs Jan 28, 2019
.travis.yml run test and lint on CI Jan 28, 2019
Makefile
README.md fix: miss Jan 28, 2019
go.mod update Makefile Jan 28, 2019
go.sum update Makefile Jan 28, 2019
main.go update usage Jan 28, 2019
version bump 0.0.2 Jan 28, 2019

README.md

mdtoc

Build Status

Generatr and insert table of content with markdown.

Usage

$ mdtoc --help
NAME:
   mdtoc - A new cli application

USAGE:
   mdtoc [global options] command [command options] [arguments...]

VERSION:
   0.0.1

COMMANDS:
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --file value, -f value   Specify to generate TOC.
   --in-file, -i            Insert TOC to md file specified --file option.
   --level value, -l value  (default: 2)
   --help, -h               show help
   --version, -v            print the version

Install

$ brew install takaishi/fomulas/mdtoc

Example

$ cat example.md
# This is example

<!-- toc -->

## foo

aaa

## bar

bbb

Output markdown with TOC to stcout:

$ mdtoc -f ./example.md
# This is example

<!-- toc -->
<!-- toc:start -->

  * [foo](#foo)
  * [bar](#bar)

<!-- toc:end -->

## foo

aaa

## bar

bbb

Overwrite file with TOC :

$ mdtoc -f ./example.md -i
$
$ cat example.md
# This is example

<!-- toc -->
<!-- toc:start -->

  * [foo](#foo)
  * [bar](#bar)

<!-- toc:end -->

## foo

aaa

## bar

bbb

Copyright

  • Copyright(c) 2019- r_takaishi