Sha256: f58a654081a2e4842b983fae888d0dc2d31e2b03ac8681a718758a3ba866b5fb

Contents?: true

Size: 1.19 KB

Versions: 4

Compression:

Stored size: 1.19 KB

Contents

# 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:

```ruby
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:

```ruby
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.

```ruby
<%= 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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
middleman-page-toc-0.2.1 README.md
middleman-page-toc-0.1.3 README.md
middleman-page-toc-0.1.2 README.md
middleman-page-toc-0.1.1 README.md