Markdown Table of Contents generator

Intro

Some ruby and shell code to generate Table of Contents for your Markdown document. The original version of the ruby code is available here generate_toc.rb

(Author albertodebortoli)

How it works

  • Script search *md file
    • For each md file found, the script check if a TOC is already generated
    • Generate TOC using generate_toc_rb script
    • Check if TOC can be generated for this md file
      • Copy TOC in the md file
  • Finaly you have to add/commit/push your nice MD file to your repo 😉

you can use this script for lazy poeple gacp script

Manual

Download Repo

git clone git@github.com:shitana/md_TOC_generator.git

Copy scripts to /usr/bin

cd md_TOC_generator
sudo cp generate_toc* /usr/bin/

Example

generate_toc /home/shitana
  Generate TOC in progress for /home/shitana/github/md_TOC_generator/README.md
  TOC already exists for /home/shitana/github/git_tools/README.md