Vizel API / core/src / VizelWikiLinkOptions
Interface: VizelWikiLinkOptions
Defined in: packages/core/src/extensions/wiki-link.ts:28
Options for the Wiki Link extension
Properties
encoding?
optional encoding?: VizelMarkdownLossyEncodingMode;Defined in: packages/core/src/extensions/wiki-link.ts:95
Markdown encoding mode.
"default"emits the lossy form ([[page]]for Obsidian-style flavors,[display](wiki://page)otherwise). The page identifier survives only via the URL portion."metadata-comment"appends a trailing<!-- vizel:wikiLink page="..." -->comment to the lossy form so the page name survives round-trips even when the display text and the visible link diverge.
Default
"default"existingClass?
optional existingClass?: string;Defined in: packages/core/src/extensions/wiki-link.ts:59
CSS class for existing page links.
Default
"vizel-wiki-link--existing"getPageSuggestions?
optional getPageSuggestions?: (query) => VizelWikiLinkSuggestion[];Defined in: packages/core/src/extensions/wiki-link.ts:47
Get page suggestions for autocomplete. Return an empty array to disable autocomplete.
Parameters
| Parameter | Type |
|---|---|
query | string |
Returns
HTMLAttributes?
optional HTMLAttributes?: Record<string, unknown>;Defined in: packages/core/src/extensions/wiki-link.ts:70
Additional HTML attributes to add to wiki links.
newClass?
optional newClass?: string;Defined in: packages/core/src/extensions/wiki-link.ts:65
CSS class for non-existing page links.
Default
"vizel-wiki-link--new"onLinkClick?
optional onLinkClick?: (pageName, event) => void;Defined in: packages/core/src/extensions/wiki-link.ts:53
Callback when a wiki link is clicked. If not provided, the default browser navigation is used.
Parameters
| Parameter | Type |
|---|---|
pageName | string |
event | MouseEvent |
Returns
void
pageExists?
optional pageExists?: (pageName) => boolean;Defined in: packages/core/src/extensions/wiki-link.ts:41
Check if a page exists. Used for visual differentiation between existing and non-existing pages.
Parameters
| Parameter | Type |
|---|---|
pageName | string |
Returns
boolean
Default
() => trueresolveLink?
optional resolveLink?: (pageName) => string;Defined in: packages/core/src/extensions/wiki-link.ts:34
Resolve a page name to a URL. Called when rendering the link in the editor.
Parameters
| Parameter | Type |
|---|---|
pageName | string |
Returns
string
Default
(pageName) => #${pageName}
serializeAsWikiLink?
optional serializeAsWikiLink?: boolean;Defined in: packages/core/src/extensions/wiki-link.ts:80
Whether to serialize wiki links as [[page]] syntax in Markdown output. When false, wiki links are serialized as standard Markdown links [text](wiki://page). Set automatically by createVizelExtensions() based on the editor's flavor:
truefor Obsidian flavorfalsefor all other flavors
Default
false