codeSnippet()
ts
function codeSnippet(path, options?): Node;Defined in: code-snippet.ts:146
Builder-element for a code-snippet
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Path of the code-snippet |
options? | CodeSnippetOptions | Additional options for this element |
Returns
A markdown node
Example
ts
import { define, codeSnippet } from "@ogs-gmbh/markdown";
const markdown = define(
codeSnippet("path/to/code-snippet.ts", { language: "ts" })
);
console.assert(
markdown.toString()
);See
https://vitepress.dev/guide/markdown#import-code-snippets
Since
1.0.0
Author
Simon Kovtyk