3 unstable releases

0.2.1 Oct 3, 2019
0.2.0 Aug 4, 2019
0.1.0 Aug 3, 2019

#15 in #generate-table

MIT license

10KB
178 lines

mdtoc

mdtoc, short for markdown table of contents, creates a table of contents for Markdown documents.

Markdown table of contents is useful because in additional to providing an overview of the document, it also allows you to jump between headers for easy navigation! For example, try this link which brings you to the TODO section of this README.

Table of Contents

  1. mdtoc
    1. Overview
    2. Demo
    3. TODO

Overview

~
  $ mdtoc --help
mdtoc 0.2.0
Jack <jchoi5@me.com>
generate table of contents for markdown

USAGE:
    mdtoc [OPTIONS] <file>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -b, --bullet <bullet>    Bullet to use for the lists, for example '*', '-', '1.' [default: 1.]
    -t, --indent <indent>    Number of space character, ' ', to use to represent a single indent [default: 4]

ARGS:
    <file>    Markdown file to read

Demo

~
  $ cat in.md
# README

## tWo 1

### tHReE 1

## TWo 2

~
  $ mdtoc in.md
## Table of Contents

1. [README](#readme)
    1. [tWo 1](#two-1)
        1. [tHReE 1](#three-1)
    1. [TWo 2](#two-2)

TODO

  1. output the original md with toc inserted into it?

Dependencies

~7MB
~128K SLoC