Devlog

Fast TOC

Fast TOC is a WordPress plugin that generates a table of contents from the headers in your post.

Installing and basic working

After you selected the post types you want to have a table of contents in the settings, you can (de)select it for each separate post in the Gutenberg document sidebar.

A TOC is generated by scanning all the header elements (H1 until H6) in the post. By default it is placed on top of the page, but you can specify a different position by using the fast-toc shortcode.

Settings

Go the the Settings / Reading section after installing the plugin. There you can setup the plugin. Below all settings are explained.

Post types

Select the post types you want to have a table of contents. If you don’t select a specific post type, no TOC option is presented for this type of post.

Enable

Enable Fast TOC by default for all selected post types. When this option is selected, a TOC is displayed by default for all selected post types. You can however disable a TOC for each separate post.

Root selector

If you leave this blank, your post content will be wrapped inside a DIV element. If you don’t want this, enter here the CSS selector of the root element that wraps your content. For example for some default WordPress themes this selector is .entry-content.

Ignore selector

You can optionally specify a CSS selector for headings you don’t want to include in the TOC. This can be handy when you use other plugins to show content and they use header elements (H1, H2, etc.).

Title

Optionally specify a title above the TOC.

Minimum number of headers

If there are less then the specified number of headers, no TOC is displayed.

TOC items

Enable or disable collapsing of items and subitems.

TOC list

Enable or disable collapsing of the TOC.

Show numbers

Select this if you want to show header numbers (or bullets) next to the header titles.

Number style

This is the style of the numbering (or bullets). Some valid values are decimal, decimal-leading-zero, lower-roman, arabic-indic, etc. See a demo page with more valid values.

Nested numbers

Select this if you want the subitem numbering to be nested.

Example nested numbers

1. Header 1
2. Header 2
   2.1. Header 2.1

Example non-nested numbers

1. Header 1
2. Header 2
   1. Header 2.1

Nested number separator

The character that separates the nested numbers, can be anything but is a dot “.” by default.

Shortcode

You can optionally place a shortcode inside the post to specifiy a different position than the default one which is at the top of the post.

The shortcode is:

[fast-toc]