Table of content model for Notebook files.

Hierarchy (view full)

Constructors

Properties

_cellToHeadingIndex: WeakMap<Cell<ICellModel>, number>
_errorCells: Cell<ICellModel>[]
_runningCells: Cell<ICellModel>[]
configMetadataMap: {
    [k: keyof TableOfContents.IConfig]: string[];
} = ...

Mapping between configuration options and notebook metadata.

If it starts with !, the boolean value of the configuration option is opposite to the one stored in metadata. If it contains /, the metadata data is nested.

Type declaration

parser: null | IMarkdownParser

Markdown parser

Sanitizer

stateChanged: Signal<NotebookToCModel, void>

A signal emitted when any model state changes.

The widget to search in

Accessors

  • get activeHeading(): null | H
  • Current active entry.

    Returns null | H

    table of contents active entry

  • get documentType(): string
  • Type of document supported by the model.

    Notes

    A data-document-type attribute with this value will be set on the tree view .jp-TableOfContents-content[data-document-type="..."]

    Returns string

  • get headings(): H[]
  • List of headings.

    Returns H[]

    table of contents list of headings

  • get isActive(): boolean
  • Whether the model is active or not.

    Notes

    An active model means it is displayed in the table of contents. This can be used by subclass to limit updating the headings.

    Returns boolean

  • set isActive(v): void
  • Whether the model needs to be kept up to date or not.

    Notes

    This is set to true if the ToC panel is visible and to false if it is hidden. But some models may require to be always active; e.g. to add numbering in the document.

    Parameters

    • v: boolean

    Returns void

  • get isAlwaysActive(): boolean
  • Whether the model gets updated even if the table of contents panel is hidden or not.

    Returns boolean

  • get isDisposed(): boolean
  • Test whether the model is disposed.

    Returns boolean

  • get title(): undefined | string
  • Document title

    Returns undefined | string

  • set title(v): void
  • Document title

    Parameters

    • v: undefined | string

    Returns void

Methods

  • Set a new active heading.

    Parameters

    • heading: null | INotebookHeading

      The new active heading

    • Optional emitSignal: boolean

      Whether to emit the activeHeadingChanged signal or not.

    Returns void