Skip to content

RenderInternalLinkParams

Parameters for renderInternalLink.

Import:

import type { RenderInternalLinkParams } from '@mnaoumov/obsidian-lib/markdown';

Signature:

export interface RenderInternalLinkParams

Properties

PropertyTypeDescription
afterReveal?() => Promise<void> | voidCalled after a click has revealed the link's destination in the file explorer, once the explorer has finished taking the focus for it — so this is where a caller moves the focus somewhere else.

Awaited, and called only for a click that reveals: always for a folder link, and for a file link only with RenderInternalLinkParams.shouldRevealFile and a destination that exists. With the file explorer disabled it is still called, right away, since there is then nothing to wait for.
appAppThe Obsidian app instance.
displayText?stringThe text to display for the internal link.
folderNote?RenderInternalLinkFolderNoteOptionsHow to answer which note is a folder's folder note, when the link names a FOLDER.

Omitted means FolderNoteLocation.Auto: the installed folder-notes plugin's live configuration, or a note named after its folder, inside it, when that plugin is absent. Pass { location: FolderNoteLocation.None } for a folder link that must only ever reveal.
pathOrAbstractFilePathOrAbstractFileThe path or abstract file to render the internal link for.
shouldRevealFile?booleanWhether clicking a FILE link also highlights that file in the file explorer, on top of the open Obsidian's own link handler performs.

Opt-in, unlike the folder branch: a folder link has always revealed (revealing was all its click could mean), whereas a file link has always only opened — so turning this on by default would change what every existing caller's link does.

Links to this page: