GenerateMarkdownLinkParams
Params for generateMarkdownLink.
Import:
import type { GenerateMarkdownLinkParams } from 'obsidian-dev-utils/obsidian/link';Signature:
export interface GenerateMarkdownLinkParamsProperties
| Property | Type | Description |
|---|---|---|
| alias? | string | An alias for the link. |
| app | App | An Obsidian app instance. |
| isEmbed? | boolean | Indicates if the link should be embedded. If not provided, it will be inferred based on the file type. If true: ![[target]].If false: [[target]]. |
| isEmptyEmbedAliasAllowed? | boolean | Whether to allow an empty alias for embeds. Applicable only if the result link style is LinkStyle.Markdown.If true: .If false: !. |
| isNonExistingFileAllowed? | boolean | Whether to allow non-existing files. If false and targetPathOrFile is a non-existing file, an error will be thrown. |
| isSingleSubpathAllowed? | boolean | Whether to allow a single subpath. Applicable only if targetPathOrFile and sourcePathOrFile are the same file.If true: [[#subpath]].If false: [[source#subpath]] |
| linkPathStyle? | LinkPathStyle | A style of the link path. |
| linkStyle? | LinkStyle | A style of the link. |
| originalLink? | string | An original link text. If provided, it will be used to infer the values of - isEmbed - linkStyle - shouldUseAngleBrackets - shouldUseLeadingDotForRelativePaths - shouldUseLeadingSlashForAbsolutePathsThese inferred values will be overridden by corresponding settings if specified. |
| shouldEscapeAlias? | boolean | Whether to escape the alias. Applicable only if the result link style is LinkStyle.Markdown.If true: .If false: . |
| shouldIncludeAttachmentExtensionToEmbedAlias? | boolean | Whether to include the attachment extension in the embed alias. Applicable only if isEmptyEmbedAliasAllowed is false.If true: .If false: . |
| shouldUseAngleBrackets? | boolean | Indicates if the link should use angle brackets. Applicable only if linkStyle is LinkStyle.Markdown.If true: .If false: . |
| shouldUseLeadingDotForRelativePaths? | boolean | Indicates if the link should use a leading dot. Applicable only if linkPathStyle is LinkPathStyle.RelativePathToSource.If true: [[./relative/path/to/target]]If false: [[relative/path/to/target]] |
| shouldUseLeadingSlashForAbsolutePaths? | boolean | Indicates if the link should use a leading slash. Applicable only if linkPathStyle is LinkPathStyle.AbsolutePathInVault.If true: [[/absolute/path/to/target]]If false: [[absolute/path/to/target]] |
| sourcePathOrFile | PathOrFile | A source path of the link. |
| subpath? | string | A subpath of the link. Should be empty or start with #. |
| targetPathOrFile | PathOrFile | A target path or file. |
Links to this page: