The table of contents plug-in provides a quick way to insert a table of contents and index to a document. The entries are automatically created from the level 1 and 2 headings in the document.
Installing the table of contents plug-in requires two steps, installing the plug-in jar and adding the menu item the configuration file.
To install the plugin, simply upload the plugin JAR and add the following to your configuration file
<advancedapis jar="toc.jar" class="com.ephox.toc.Toc" />
Please note, the value for the jar attribute of <advancedapis> element should include the path to the location of the JAR.
For additional information on including a plugin, please refer to the article "Including a plugin in EditLive! v7".
To add the menu item, simple add the following to the appropriate menu in your configuration file.
<menuItem name="createTableOfContents" action="raiseEvent" value="createTableOfContents" text="Generate Table of Contents"/>
In the example configuration file, it's located under the Tools menu.
Users create their document as normal, using the appropriate Heading 1 and Heading 2 styles to label headings and then select "Generate Table of Contents" from the menu. The plug-in will insert a table of contents at the top of the page and an index at the bottom. If the index or table of contents already exists, it will be updated.