Skip to content

include()

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

Defined in: include.ts:84

Builder-element for an include directive

Parameters

ParameterTypeDescription
pathstringPath to the file to include
options?IncludeOptionsOptions for the include directive

Returns

Node

A markdown node

Example

ts
import { define, include } from "@ogs-gmbh/markdown";

const markdown = define(
  include("path/to/file.md", { range: { from: 5, to: 10 } })
);

console.assert(
  markdown.toString()
);

See

https://vitepress.dev/guide/markdown#markdown-file-inclusion

Since

1.0.0

Author

Simon Kovtyk