<commit_before># PageTocFilter

## Installation

Add this line to your application's Gemfile:

``` ruby
gem 'page-toc-filter'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install page-toc-filter

## Usage

TODO: Write usage instructions here<commit_msg>Update README usage<commit_after># PageTocFilter

## Installation

Add this line to your application's Gemfile:

``` ruby
gem 'page-toc-filter'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install page-toc-filter

## Usage

The simplest way to do this is

``` ruby
require 'extended-markdown-filter'
```

Then, place this filter *after* you've rendered your content through the Markdown and TOC filters:

``` ruby
pipeline = HTML::Pipeline.new([
  HTML::Pipeline::MarkdownFilter,
  HTML::Pipeline::TableOfContentsFilter,
  HTML::Pipeline::PageTocFilter
])
```

By default, only `h2` headings will be converted into a table of contents. You can change this with the optional `toc_levels` setting, which should be a comma-separated string of heading levels. For example:

``` ruby
pipeline = HTML::Pipeline.new([
  HTML::Pipeline::MarkdownFilter,
  HTML::Pipeline::TableOfContentsFilter,
  HTML::Pipeline::PageTocFilter
], { :toc_levels => 'h2, h3' })
```
{'fraction_non_alphanumeric': 0.11277602523659307, 'fraction_numerical': 0.002365930599369085, 'mean_word_length': 4.716216216216216, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1808583', 'n_tokens_mistral': 412, 'n_tokens_neox': 376, 'n_words': 131}