Vizel API / core/src / createVizelWikiLinkExtension
Function: createVizelWikiLinkExtension()
ts
function createVizelWikiLinkExtension(options?): Mark<VizelWikiLinkOptions, any>;Defined in: packages/core/src/extensions/wiki-link.ts:444
Create a configured Wiki Link extension for Vizel editor.
Wiki links use [[page-name]] syntax for linking between pages. Supports display text aliases with [[page-name|display text]].
Parameters
| Parameter | Type |
|---|---|
options | VizelWikiLinkOptions |
Returns
Mark<VizelWikiLinkOptions, any>
Examples
Basic usage
typescript
const extension = createVizelWikiLinkExtension();With custom link resolution
typescript
const extension = createVizelWikiLinkExtension({
resolveLink: (page) => `/wiki/${encodeURIComponent(page)}`,
pageExists: (page) => pages.has(page),
onLinkClick: (page) => router.push(`/wiki/${page}`),
});With autocomplete
typescript
const extension = createVizelWikiLinkExtension({
getPageSuggestions: (query) =>
allPages
.filter((p) => p.toLowerCase().includes(query.toLowerCase()))
.map((name) => ({ name })),
});