Table Of Contents (Outline)
Introduction
Using this plugin, users can extract a table of contents using regular formatting.
Installation
npm install commajs-outline
In commajs-core options add:
import CommaOutline from "commajs-outline";
options = {
...,
plugins: [
...,
{ pClass: CommaOutline }
]
}
Styling
Table Of Contents is styled using the css file that you can find in the commajs-outline package.
Usage
To add the current line to the Table of Contents:
commajsInstance.InsertPluginAtSection(CommaOutline.GetName(), "h1");
The Table of Contents plugin accepts a string representing the content 'level' for the line as parameter . Content level can be any of the following values: h1, h2, h3, or normal. The 'normal' value will remove the line from the Table of Contents.
To open the Table of Contents:
commajsInstance.CallPluginStaticMethod(CommaOutline.GetName(), 'OpenNavigationPanel')