Sha256: 0ffae0af7ff5c78e598f8005830ecc66b044e4e235ed13f95671a0f90ac24fe9

Contents?: true

Size: 1.13 KB

Versions: 4

Compression:

Stored size: 1.13 KB

Contents

# Table of Contents

A table of contents for each page is generated by default. The items in the table of contents are derived from the headers in each section (i.e. _Markdown_ elements defined with one or more `#` characters).

To disable the table of contents, set `config.table_of_contents` to `false`:

```ruby
# spec/spec_helper.rb

RSpec::Documentation.configure do |config|
  config.table_of_contents = false # Default: true
end
```

## Overriding for Specific Pages

If you want to disable the Table of Contents globally but enable for specific pages, add the following anywhere in your _Markdown_ document:

```markdown
* TOC
{:toc}
```

## Omit a Specific Header from Table of Contents

To omit a specific header element from the Table of Contents, add `{:.no_toc}` underneath the header:

```markdown
## Header included in Table of Contents

## Header not included in Table of Contents
{:.no_toc}
```

See the [`kramdown` documentation](https://kramdown.gettalong.org/converter/html.html#toc) for more details. Aside from injecting _RSpec_ examples into the output, each _Markdown_ document is passed transparently to _kramdown_ for processing.

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rspec-documentation-0.0.11 rspec-documentation/pages/060-Configuration/Table of Contents.md
rspec-documentation-0.0.10 rspec-documentation/pages/060-Configuration/Table of Contents.md
rspec-documentation-0.0.9 rspec-documentation/pages/060-Configuration/Table of Contents.md
rspec-documentation-0.0.8 rspec-documentation/pages/060-Configuration/Table of Contents.md