Options
All
  • Public
  • Public/Protected
  • All
Menu

Toc: generates a table of contents by searching for headers in documents

Index

Type aliases

Functions

Type aliases

TocBase

TocBase: TocBaseItem[]

TocBaseItem

TocBaseItem: { children?: TocBase; isSection?: boolean; link?: string; listType?: ListType; title?: string }

Type declaration

  • Optional children?: TocBase
  • Optional isSection?: boolean
  • Optional link?: string
  • Optional listType?: ListType
  • Optional title?: string

Functions

default

  • default(doc: Document): Heading[]
  • Generates a table of contents tree from headings in a Document.

    Parameters

    • doc: Document

      Document

    Returns Heading[]

    A tree-like structure representing table of contents.

getToc

  • Generates a table of contents for the whole book. If there’s no tocBase, uses the metadata based on readingOrder filelist.

    Parameters

    • meta: DocumentMetadata[]

      Metadata collected from all documents, including document TOCs

    • preview: Preview
    • Optional tocBase: TocBase

      Basic TOC structure (without document TOCs)

    Returns DocumentFragment

    Document fragment to be included on top of every document

Generated using TypeDoc