Skip to content

codeSnippet()

ts
function codeSnippet(path, options?): Node;

Defined in: code-snippet.ts:146

Builder-element for a code-snippet

Parameters

ParameterTypeDescription
pathstringPath of the code-snippet
options?CodeSnippetOptionsAdditional options for this element

Returns

Node

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