FileManager
› generateMarkdownLink
FileManager.generateMarkdownLink() method
Generate a Markdown link based on the user’s preferences.
Signature:
generateMarkdownLink(file: TFile, sourcePath: string, subpath?: string, alias?: string): 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 | (Optional) A subpath, starting with # , used for linking to headings or blocks. |
alias | string | (Optional) The display text if it’s to be different than the file name. Pass empty string to use file name. |
Returns:
string