Light Mode Dark Mode

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:

# spec/spec_helper.rb

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

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:


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:

## Header included in Table of Contents

## Header not included in Table of Contents

See the kramdown documentation for more details. Aside from injecting RSpec examples into the output, each Markdown document is passed transparently to kramdown for processing.

Documentation generated by rspec-documentation