Skip to content

FileManager.generateMarkdownLink method

FileManager › generateMarkdownLink

Official

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

Signature:

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

Parameters:

Parameter Type Description
file TFile the file to link to.
sourcePath string where the link is stored in, used to compute relative links.
subpath? string | undefined A subpath, starting with #, used for linking to headings or blocks.
alias? string | undefined The display text if it's to be different than the file name. Pass empty string to use file name.

Returns: string

Since: 0.12.0