Pau Table of Contents Block

Plugin Banner

Pau Table of Contents Block

by Timothy Paustian

Download
Description

This plugin is a Gutenberg block that takes a collection of posts organized by category (book name) and subcategories (chapter names)
and creates a table of contents from them. You simply choose the root category to use, and the plugin does the rest. Once
the table of contents is made, you can sort the chapters and posts, and the plugin will remember the order. The plugin also
creates links to the next and previous posts.

Source Code

The Pau Table of Contents Block is a Gutenberg block created as recommended in the Block Editor Handbook
(https://developer.wordpress.org/block-editor/). As recommended by the handbook, the source code is minified by the
build process for production. In keeping with the spirit of open source, the unminified code
for Pau Table of Contents is available at GitHub (https://github.com/paustian/pau-table-of-contents-block/).

If you want to see an example of this used on a live site, check out my textbook Through the Microscope (https://textbookconsortia.com/through-the-microscope-table-of-contents/)

Minimum Requirements

  • WordPress version 6.8 or greater.
  • PHP version 7.4 or greater
  • MySQL version 5.7 or greater.

Recommended Requirements

  • Latest WordPress version.
  • PHP version 8.0 or greater.
  • MySQL version 8.0 or greater, or MariaDB 10.5 or greater.
  1. In your WordPress Dashboard, navigate to “Plugins” and then click on the “Add Plugins” button.
  2. Search for “Table of Contents Block”.
  3. Install the plugin by pressing the “Install” Button.
  4. Activate the plugin by pressing the “Activate” button.

Use the plugin to organize a collection of posts into a book. Choose a root category as the title of your book. Also, create
subcategories for each section of the book. As you write posts, assign them to the root category and the subcategory. Do not
add a post to more than one subcategory. Make sure the Table of Contents plugin is installed and activated. You can now
use the plugin as you would any other block. Create a Post or Page. Add a block and search for table of contents block. In the
block, on the sidebar, choose the root category in the dropdown menu that you created for your book. The plugin will walk
through all the posts that are in the Category and subcategories and create a table of contents from them. After creation,
chapters and articles can be moved around in the TOC. Previous and next links are automatically created when a post is displayed.

0.2.0

Initial candidate release of the plugin

Back to top