No commit activity in last 3 years
No release in over 3 years
Write a longer description or delete this line.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.6
~> 1.7
~> 1.3
~> 10.0

Runtime

< 5, >= 3.2
 Project Readme

Gem Version Build Status Coverage Status Code Climate

middleman-page-toc

An extension to Middleman which provides a helper method to render table of contents of the specified page/resource.

Installation

Add this line to your application's Gemfile:

gem 'middleman-page-toc'

And then execute:

$ bundle

Or install it yourself as:

$ gem install middleman-page-toc

Settings

Use redcarpet as markdown engine and enable :toc_data option. and then activate this extension:

set :markdown_engine, :redcarpet
set :markdown, :fenced_code_blocks => true, :autolink => true,
  :smartypants => true, :tables => true, :with_toc_data => true

activate :page_toc

Usage

use render_toc(page, options) helper function on your layout or page.

<%= render_toc(current_page) %>

options

  • :use_collapsing
  • :button_caption
  • :expand

You must setup twitter-bootstrap css/js on your environment to use collapsing.

Contributing

  1. Fork it ( https://github.com/atarukoddaka/middleman-page-toc/fork )
  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 a new Pull Request