nizel-plugin-toc
v0.1.10
Published
Rendered table of contents plugin for Nizel.
Readme
nizel-plugin-toc
Rendered table of contents support for Nizel.
The plugin converts a standalone [[toc]] marker into a linked <nav> built from parsed heading IDs.
The browser build exposes NizelToc from dist/toc.iife.js.
Install
npm install nizel-plugin-tocUsage
import { useNizel } from 'nizel';
import { tocPlugin } from 'nizel-plugin-toc';
const nizel = useNizel({
plugins: [tocPlugin()],
});Syntax
[[toc]]
## Install
## UsageOptions
| Option | Type | Default | Description |
| --- | --- | --- | --- |
| className | string | 'toc' | CSS class for the generated <nav>. |
| minDepth | number | 2 | Minimum heading depth included. |
| maxDepth | number | 6 | Maximum heading depth included. |
Output
<nav class="toc"><ol><li data-depth="2"><a href="#install">Install</a></li></ol></nav>License
MIT
