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

MethodReturnsDescription
createItemDom(e)unknownCreate a DOM element for an outline heading item.
filterSearchResults()voidFilter the outline items based on the current search query.
findActiveHeading(e)undefined | unknownFind the heading that corresponds to the current cursor position.
findCorrespondingLeaf()null | WorkspaceLeafFinds the active leaf.
getHeadings()string[]Returns the headings of the active file.
getOwner()null | ViewFinds the view to the active leaf.
getViewType()typeof ViewType.OutlineGet the current view type.
handleCollapseAll(e)voidHandle the collapse/expand all toggle action.
handleSelectionChange()voidHandle editor selection changes and highlight the active heading.
onFileChanged(file)voidHandle a file content change and refresh the outline.
onFileOpen(file)voidCalled when a file is opened. Loads the file and requests a content update.
(Inherited from InfoFileView)
onMarkdownScroll(e)voidHandle scroll events in the markdown editor and sync outline highlight.
onToggleShowSearch()voidToggles the visibility of the search.
setHighlightedItem(e)voidSet which outline item is highlighted as active.
setShowSearch(e)voidSet the visibility of the search filter.
showSearch()voidShows the search.
update()voidRefresh the outline view with current headings.
updateSearch()voidUpdates the search.

Links to this page: