FileManagergenerateMarkdownLink

Generate a Markdown link based on the user’s preferences.

Signature:

generateMarkdownLink(file: TFile, sourcePath: string, subpath?: string, alias?: string): string;

Parameters

ParameterTypeDescription
fileTFilethe file to link to.
sourcePathstringwhere the link is stored in, used to compute relative links.
subpathstring(Optional) A subpath, starting with #, used for linking to headings or blocks.
aliasstring(Optional) The display text if it’s to be different than the file name. Pass empty string to use file name.

Returns:

string