Giter VIP home page Giter VIP logo

gfm-toc's Introduction

gfm-toc

Ruby utility to generate a markdown formatted table of contents from GitHub flavored markdown files.

Usage

The utility is all contained in a single file, so you can just grab the file with curl:

# download the utility
curl -O https://raw.githubusercontent.com/atheiman/gfm-toc/master/gfm-toc
# make it executable
chmod 764 gfm-toc
# show the help
./gfm-toc -h
# update your markdown file with a %TOC% where you want the TOC generated
./gfm-toc README.md

Place %TOC% in your markdown file whereever makes sense to you. Any headers identified with a # below the %TOC% are added into the generated table of contents.

See INPUT.md and OUTPUT.md for a thorough example.

Run the utility with the -h,--help option to see the full option list.

It should work with any crazy header you can come up with.

gfm-toc's People

Contributors

atheiman avatar

Stargazers

Timo Sarkar avatar astwishin avatar Rohit Goswami avatar

Watchers

James Cloos avatar  avatar

gfm-toc's Issues

max header depth specified in toc tag

Allow specifying the max header depth to be included in the generated table of contents by passing a parameter: %TOC:2% will only inlude headers identified with # and ##

update generated toc

Allow utility to be run on the same file consecutively to get the same result (i.e. update a file and run the utility again to update the generated TOC)

Probably want to just wrap the generated TOC with a comment that say <!--START_TOC--> and <!--END_TOC-->, then just update the contents between the comments every time the utility is run.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.