Project

tocify

0.0
No commit activity in last 3 years
No release in over 3 years
Tocify is an easy way to generate a table of contents for your markdown file
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
 Project Readme

Tocify

Tocify aims to create a table of contents for your markdown files. By default the generated ToC will be dumped to STDOUT. Add the -i or --inject flag to put the table of contents back into your file.

Table of Contents

  • Installation
  • Usage
  • Sample Output
  • Manual Insertion
    • OS X
    • Linux
  • Contributing

Generated with tocify

Installation

Add this line to your application's Gemfile:

gem 'tocify'

And then execute:

$ bundle

Or install it yourself as:

$ gem install tocify

Usage

By default tocify will check for a file named README.md in the current directory.

tocify

Otherwise you can pass in a filename as a parameter.

tocify OTHERFILE.md

To automatically insert the ToC into your README, run

tocify -i

Sample Output

When running tocify on this file, you get:

## Table of Contents
* [Installation](#installation)
* [Usage](#usage)
* [Sample Output](#sample-output)
* [Manual Insertion](#manual-insertion)
    * [OS X](#os-x)
    * [Linux](#linux)
* [Contributing](#contributing)

Manual Insertion

If you want to manually insert the generated ToC you can. An easy way is to pipe the output of tocify into your paste bufffer.

OS X

tocify | pbcopy

Linux

tocify | xclip

Requires xclip to be installed

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request