Skip to content

OutlineView

Unofficial

obsidian#View that displays the headings outline for the current file.

Import:

import type { OutlineView } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface OutlineView extends InfoFileView

Extends: InfoFileView

Constructor

new OutlineView(leaf: WorkspaceLeaf, outlinePluginInstance: OutlinePluginInstance)

Constructor.

Methods

Method Returns Description
createItemDom(e) unknown Create a DOM element for an outline heading item.
filterSearchResults() void Filter the outline items based on the current search query.
findActiveHeading(e) undefined | unknown Find the heading that corresponds to the current cursor position.
findCorrespondingLeaf() null | WorkspaceLeaf Finds the active leaf.
getHeadings() string[] Returns the headings of the active file.
getOwner() null | View Finds the view to the active leaf.
getViewType() typeof ViewType.Outline Get the current view type.
handleCollapseAll(e) void Handle the collapse/expand all toggle action.
handleSelectionChange() void Handle editor selection changes and highlight the active heading.
onFileChanged(file) void Handle a file content change and refresh the outline.
onFileOpen(file) void Called when a file is opened. Loads the file and requests a content update.
(Inherited from InfoFileView)
onMarkdownScroll(e) void Handle scroll events in the markdown editor and sync outline highlight.
onToggleShowSearch() void Toggles the visibility of the search.
setHighlightedItem(e) void Set which outline item is highlighted as active.
setShowSearch(e) void Set the visibility of the search filter.
showSearch() void Shows the search.
update() void Refresh the outline view with current headings.
updateSearch() void Updates the search.

Links to this page: