A Table of Contents plug-in for CKEditor 5

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
aaronpinero's picture

Is there any interest in a CKEditor 5 plugin to generate a Table of Contents based on the heading tags in the formatted text field? This plugin would be a 'lite' version of the official CKEditor Table of Contents feature that requires a commercial license.

I know there are quite a few table of contents modules available as per https://www.drupal.org/node/2278811. However, most of these module use a JavaScript implementation for creating the table of contents. My proposed contrib module integrates with CKEditor 5, providing a plugin and an input filter. The table of contents, instead of being generated by JavaScript, is generated in PHP. This approach trades the limitation of only using the headings within the same formatted text field for the flexibility of allowing the content editor to place the table of contents where they want.

Comments

Maybe have a look at the TOC

eelkeblok's picture

Maybe have a look at the TOC filter project. It does a similar thing, but without a dependency on CKEditor.

@eelkeblok Thank you for the

aaronpinero's picture

@eelkeblok Thank you for the suggestion. This module offers quite a bit of what I'm looking for. It would be nice if it included the CKEditor widget for inserting and customizing the token -- I know it seems silly, but it would truly be easier for some users -- but perhaps I can build the widget myself from code I've already written to work with this module.

Contributed Module Ideas

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week