Skip to content

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?

ts
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

ts
"default"

existingClass?

ts
optional existingClass?: string;

Defined in: packages/core/src/extensions/wiki-link.ts:59

CSS class for existing page links.

Default

ts
"vizel-wiki-link--existing"

getPageSuggestions?

ts
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

ParameterType
querystring

Returns

VizelWikiLinkSuggestion[]


HTMLAttributes?

ts
optional HTMLAttributes?: Record<string, unknown>;

Defined in: packages/core/src/extensions/wiki-link.ts:70

Additional HTML attributes to add to wiki links.


newClass?

ts
optional newClass?: string;

Defined in: packages/core/src/extensions/wiki-link.ts:65

CSS class for non-existing page links.

Default

ts
"vizel-wiki-link--new"

onLinkClick?

ts
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

ParameterType
pageNamestring
eventMouseEvent

Returns

void


pageExists?

ts
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

ParameterType
pageNamestring

Returns

boolean

Default

ts
() => true

ts
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

ParameterType
pageNamestring

Returns

string

Default

(pageName) => #${pageName}


ts
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:

  • true for Obsidian flavor
  • false for all other flavors

Default

ts
false

Released under the MIT License.