Giter VIP home page Giter VIP logo

markdown_toc's Introduction

mdtoc.rb

Release 1.0.2.

Build Status

Overview

This script can be used to generate a Markdown Table of Contents from a Markdown source document. For more information, see my related blog post.

Dependencies

You only require a system Ruby. Tested on Ruby versions 1.9 through to 2.7.

Installation

Install by copying the script from the master branch:

Docker install

To build the docker file run.

docker build .

To run the docker file against your README. CD into your directory and run (this assumes your readme file is README.md)

docker run -v `pwd`:/host <name of image>
▶ curl \
  https://raw.githubusercontent.com/alexharv074/markdown_toc/master/mdtoc.rb -o \
  /usr/local/bin/mdtoc.rb

Usage

Help message:

▶ mdtoc.rb -h
Usage: mdtoc.rb FILE.md [TOP [MAX]] [-h]
     FILE.md          Markdown source document
     TOP              top-level Markdown heading level (default 2)
     MAX              maximum heading level (default 4)

On Mac OS X, the pbcopy command is useful, for example:

▶ mdtoc.rb README.md | pbcopy
▶ vim README.md # then paste in the ToC!

More examples

Look in the tests.

License

MIT.

markdown_toc's People

Contributors

alexharv074 avatar charltonaustin avatar

Watchers

James Cloos avatar

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.