Problem/Motivation
I realize to many this may seem silly, but asking some content authors to remember the correct token and type it into the text editor in the right way is asking quite a bit. Also, the documentation for this module is lacking or difficult to find, so users may not immediately know the correct token to use.
Proposed resolution
I suggest creating a submodule or companion module for toc_filter that provides a CKE5 widget for inserting the TOC token into the formatted text field. This will make life easier for content authors as it will create an appropriate block widget with the correct token.
I've created a rough draft of a module that will provide the necessary widget. It is functional but lacks features. What it does is based on my own needs:
- provides a CKE5 editor button that will insert a TOC widget
- provides a contextual UI element for the TOC widget with an option to display the TOC in a block (as opposed to in the formatted text field).
The module currently lacks
- explicit dependence on the top_filter module
- requirement of the toc_filter filter to be active in order to add the widget to the editor toolbar
- an icon for the tool bar button
- additional option in the contextual ui to override the TOC style
I am going to work on the first two items but the other two I don't really need. However, for a proper contributed module these would probably be good to have.
I'm happy to contribute the code I've already written toward the completion of a finished, ready-for-release module. I'm a bit of a novice so I could use some help with the outstanding items. Also, I'm not sure how a contribution like this should work. I see a few options:
- add this module as a submodule of toc_filter and submit a merge request
- add the CKE5 widget as part of the main toc_filter module and submit a merge request
- create my own contributed module separate from toc_filter and describe, in documentation, how the module should be used with toc_filter
Suggestions are welcome.