Toc is a block for Table of Contents for ContentArchitect editor. Toc creates a table of contents based on the titles in the editor body. It does this automatically. It takes into account hierarchy.
If you are using node you can install it:
npm i -S @contentarchitect/toc
or yarn add @contentarchitect/toc
after this:
import Toc from '@contentarchitect/toc'
ContentArchitect.Blocks.register(Toc)
In your web page:
<script src="https://unpkg.com/@contentarchitect/toc"></script>
<script>
ContentArchitect.Blocks.register(Toc)
</script>
- No need JS for on the viewing side (Editor side rendering)
- Automatic detection of headers changes
- Style customization with class options