Class PythonTableOfContentsModel

Table of content model for Python files.




stateChanged: Signal<PythonTableOfContentsModel, void>

A signal emitted when any model state changes.


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

    Returns H

    table of contents active entry

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


    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.


    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.


    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.


    • v: boolean

    Returns void

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


    For example, ToC models use to add title numbering will set this to true.

    Returns boolean

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

    Returns boolean

  • get supportedOptions(): (keyof TableOfContents.IConfig)[]
  • List of configuration options supported by the model.

    Returns (keyof TableOfContents.IConfig)[]

  • get title(): string
  • Document title

    Returns string

  • set title(v): void
  • Document title


    • v: string

    Returns void


  • Dispose the model.

    Returns void

  • Set a new active heading.


    • heading: IEditorHeading

      The new active heading

    • Optional emitSignal: boolean

      Whether to emit the activeHeadingChanged signal or not.

    Returns void

  • Callback on heading collapse.


    • options: {
          collapsed?: boolean;
          heading?: IEditorHeading;
      • Optional collapsed?: boolean

        The new collapsed status (toggle existing status if not provided)

      • Optional heading?: IEditorHeading

        The heading to change state (all headings if not provided)

    Returns void

Generated using TypeDoc