wikiLink()
Support wiki-style `[[links]]` with optional aliases.
import { wikiLink } from "@unifast/node";Signature
function wikiLink(options?: WikiLinkPluginOptions): UnifastPluginParameters
options?
Configuration for wiki link behavior
| Property | Type | Default | Description |
|---|---|---|---|
hrefTemplate | string | "/wiki/${slug}" | Template for generating link URLs. Use ${slug} as a placeholder for the slugified page name. |
Usage
import { compile, wikiLink } from "@unifast/node";
const md = `Check out [[Getting Started]] for an introduction.`;
const result = compile(md, {
plugins: [
wikiLink({
hrefTemplate: "/docs/${slug}",
}),
],
});
console.log(result.output);
// <p>Check out <a href="/docs/getting-started">Getting Started</a> for an introduction.</p>