Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

1.6 KB
Raw Blame

@univerjs/docs-toc

npm version license downloads

@univerjs/docs-toc provides table-of-contents insertion, update, deletion, and FIELD-range lookup for Univer Docs.

Package Overview

Package UMD global CSS Locales Facade entry Worker entry
@univerjs/docs-toc UniverDocsToc No No No No

Installation

pnpm add @univerjs/docs-toc
# or
npm install @univerjs/docs-toc

Usage

Start with the integration setup for your document type, including its required plugins, styles, and locale resources. The snippet below assumes that setup is complete.

import { UniverDocsTocPlugin } from '@univerjs/docs-toc';

univer.registerPlugin(UniverDocsTocPlugin);

Use this package with @univerjs/docs-toc-ui when users need Ribbon, context-menu, dialog, and active-range feedback.

The updater currently evaluates outline-based TOC instructions (\\o). Other Word TOC switches are retained in FIELD metadata but are not all evaluated.

Resources