jangroth / markdownhelper

Python CLI to add TOC to markdown documents

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build_status

CLI Helper for Markdown

Adds or removes table of contents to markdown document.

./bin/mdh --help
Usage: mdh_cli.py [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  cleanse  Removes existing TOC and all internal links
  dump     Dumps markdown document to console
  toc      Adds TOC to top of file

Usage

Add new TOC. This will also remove the old TOC, if it was rendered with mdh.

./bin/mdh toc tests/resources/simple.md 

Optionally, add navigation arrows to headers:

./bin/mdh toc --navigation tests/resources/simple.md 

Optionally, only render up to top level:

./bin/mdh toc --top-level 2 tests/resources/simple.md 

If necessary, remove old TOC:

./bin/mdh cleanse tests/resources/simple.md 

Dump existing document:

./bin/mdh dump tests/resources/simple.md 

Screenshots

Before

before

After

after

About

Python CLI to add TOC to markdown documents

License:GNU General Public License v3.0


Languages

Language:Python 96.8%Language:Makefile 3.1%Language:Shell 0.1%