@temelj/mdx 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler.d.ts +17 -15
- package/dist/compiler.js +67 -68
- package/dist/mod.d.ts +13 -3
- package/dist/mod.js +1 -1
- package/dist/plugins/heading-id/plugin.d.ts +8 -5
- package/dist/plugins/heading-id/plugin.js +18 -15
- package/dist/plugins/mod.d.ts +8 -4
- package/dist/plugins/remove-imports-exports.d.ts +7 -4
- package/dist/plugins/remove-imports-exports.js +8 -8
- package/dist/plugins/syntax-highlight/code-meta.d.ts +10 -7
- package/dist/plugins/syntax-highlight/code-meta.js +41 -41
- package/dist/plugins/syntax-highlight/plugin.d.ts +10 -8
- package/dist/plugins/syntax-highlight/plugin.js +134 -122
- package/dist/plugins/tree-processor/plugin.d.ts +8 -6
- package/dist/plugins/tree-processor/plugin.js +20 -17
- package/dist/types.d.ts +1 -2
- package/dist/types.js +0 -1
- package/package.json +9 -4
- package/.turbo/turbo-build.log +0 -4
- package/compiler.test.ts +0 -117
- package/compiler.ts +0 -124
- package/mod.ts +0 -3
- package/plugins/heading-id/plugin.ts +0 -42
- package/plugins/mod.ts +0 -4
- package/plugins/remove-imports-exports.ts +0 -18
- package/plugins/syntax-highlight/code-meta.test.ts +0 -22
- package/plugins/syntax-highlight/code-meta.ts +0 -76
- package/plugins/syntax-highlight/plugin.ts +0 -266
- package/plugins/tree-processor/plugin.ts +0 -54
- package/tsconfig.json +0 -18
- package/types.ts +0 -3
package/dist/compiler.d.ts
CHANGED
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
1
|
+
import { CompileOptions } from '@mdx-js/mdx';
|
|
2
|
+
export { default as remarkFrontmatterPlugin } from 'remark-frontmatter';
|
|
3
|
+
export { default as remarkGfmPlugin } from 'remark-gfm';
|
|
4
|
+
import { Plugin } from 'unified';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { Node } from 'hast';
|
|
7
|
+
|
|
8
8
|
/**
|
|
9
9
|
* Represents the source content for an MDX document.
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
type MdxSource = string | Uint8Array;
|
|
12
12
|
/**
|
|
13
13
|
* Options for compiling an MDX document.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
interface MdxCompileOptions {
|
|
16
16
|
frontmatterOnly?: boolean | undefined;
|
|
17
|
-
mdxOptions?:
|
|
17
|
+
mdxOptions?: CompileOptions;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* The result of compiling an MDX document.
|
|
21
21
|
* Compiled content is optional, because sometimes we only need the frontmatter.
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
interface MdxArtifact<TFrontmatter = Record<string, unknown>> {
|
|
24
24
|
compiled?: string | undefined;
|
|
25
25
|
frontmatter: TFrontmatter;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* A reusable compiler for compiling MDX.
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
declare class MdxCompiler {
|
|
31
31
|
private readonly mdxOptions;
|
|
32
32
|
private readonly remarkPlugins;
|
|
33
33
|
private readonly rehypePlugins;
|
|
34
|
-
constructor(mdxOptions?:
|
|
35
|
-
withRemarkPlugin<TOptions>(plugin: Plugin<[TOptions?],
|
|
36
|
-
withRehypePlugin<TOptions>(plugin: Plugin<[TOptions?],
|
|
34
|
+
constructor(mdxOptions?: CompileOptions);
|
|
35
|
+
withRemarkPlugin<TOptions>(plugin: Plugin<[TOptions?], Node, Node>, options?: TOptions): MdxCompiler;
|
|
36
|
+
withRehypePlugin<TOptions>(plugin: Plugin<[TOptions?], Node, Node>, options?: TOptions): MdxCompiler;
|
|
37
37
|
compile<TFrontmatterSchema extends z.ZodSchema>(source: MdxSource, { frontmatterOnly, mdxOptions }?: MdxCompileOptions, frontmatterSchema?: TFrontmatterSchema): Promise<MdxArtifact<z.output<TFrontmatterSchema>>>;
|
|
38
38
|
}
|
|
39
|
+
|
|
40
|
+
export { type MdxArtifact, type MdxCompileOptions, MdxCompiler, type MdxSource };
|
package/dist/compiler.js
CHANGED
|
@@ -1,76 +1,75 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
compile as compileMdxJs
|
|
3
|
+
} from "@mdx-js/mdx";
|
|
2
4
|
import remarkFrontmatterPlugin from "remark-frontmatter";
|
|
3
5
|
import remarkGfmPlugin from "remark-gfm";
|
|
4
6
|
import { VFile } from "vfile";
|
|
5
7
|
import { matter } from "vfile-matter";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
mdxOptions;
|
|
12
|
-
remarkPlugins;
|
|
13
|
-
rehypePlugins;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
class MdxCompiler {
|
|
9
|
+
mdxOptions;
|
|
10
|
+
remarkPlugins;
|
|
11
|
+
rehypePlugins;
|
|
12
|
+
constructor(mdxOptions = {}) {
|
|
13
|
+
this.mdxOptions = mdxOptions;
|
|
14
|
+
this.remarkPlugins = [remarkFrontmatterPlugin, remarkGfmPlugin];
|
|
15
|
+
this.rehypePlugins = [];
|
|
16
|
+
}
|
|
17
|
+
withRemarkPlugin(plugin, options) {
|
|
18
|
+
if (options === void 0) {
|
|
19
|
+
this.remarkPlugins.push(plugin);
|
|
20
|
+
} else {
|
|
21
|
+
this.remarkPlugins.push([plugin, options]);
|
|
18
22
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return this;
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
withRehypePlugin(plugin, options) {
|
|
26
|
+
if (options === void 0) {
|
|
27
|
+
this.rehypePlugins.push(plugin);
|
|
28
|
+
} else {
|
|
29
|
+
this.rehypePlugins.push([plugin, options]);
|
|
27
30
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
outputFormat: "function-body",
|
|
61
|
-
...(this.mdxOptions ?? {}),
|
|
62
|
-
...(mdxOptions ?? {}),
|
|
63
|
-
remarkPlugins,
|
|
64
|
-
rehypePlugins,
|
|
65
|
-
});
|
|
66
|
-
compiled = compiledFile.value.toString();
|
|
67
|
-
}
|
|
68
|
-
const frontmatter = frontmatterSchema === undefined
|
|
69
|
-
? (vfile.data.matter ?? {})
|
|
70
|
-
: frontmatterSchema.parse(vfile.data.matter ?? {});
|
|
71
|
-
return {
|
|
72
|
-
compiled,
|
|
73
|
-
frontmatter: frontmatter,
|
|
74
|
-
};
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
async compile(source, { frontmatterOnly = false, mdxOptions } = {}, frontmatterSchema) {
|
|
34
|
+
const vfile = new VFile({
|
|
35
|
+
value: source,
|
|
36
|
+
// Needed so vfile doesn't need to access fs.
|
|
37
|
+
cwd: "/",
|
|
38
|
+
path: "/",
|
|
39
|
+
message: {},
|
|
40
|
+
messages: {}
|
|
41
|
+
});
|
|
42
|
+
matter(vfile, { strip: true });
|
|
43
|
+
const remarkPlugins = [
|
|
44
|
+
...this.remarkPlugins,
|
|
45
|
+
...this.mdxOptions?.remarkPlugins ?? [],
|
|
46
|
+
...mdxOptions?.remarkPlugins ?? []
|
|
47
|
+
];
|
|
48
|
+
const rehypePlugins = [
|
|
49
|
+
...this.rehypePlugins,
|
|
50
|
+
...this.mdxOptions?.rehypePlugins ?? [],
|
|
51
|
+
...mdxOptions?.rehypePlugins ?? []
|
|
52
|
+
];
|
|
53
|
+
let compiled;
|
|
54
|
+
if (!frontmatterOnly) {
|
|
55
|
+
const compiledFile = await compileMdxJs(vfile, {
|
|
56
|
+
outputFormat: "function-body",
|
|
57
|
+
...this.mdxOptions ?? {},
|
|
58
|
+
...mdxOptions ?? {},
|
|
59
|
+
remarkPlugins,
|
|
60
|
+
rehypePlugins
|
|
61
|
+
});
|
|
62
|
+
compiled = compiledFile.value.toString();
|
|
75
63
|
}
|
|
64
|
+
const frontmatter = frontmatterSchema === void 0 ? vfile.data.matter ?? {} : frontmatterSchema.parse(vfile.data.matter ?? {});
|
|
65
|
+
return {
|
|
66
|
+
compiled,
|
|
67
|
+
frontmatter
|
|
68
|
+
};
|
|
69
|
+
}
|
|
76
70
|
}
|
|
71
|
+
export {
|
|
72
|
+
MdxCompiler,
|
|
73
|
+
remarkFrontmatterPlugin,
|
|
74
|
+
remarkGfmPlugin
|
|
75
|
+
};
|
package/dist/mod.d.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export { MdxArtifact, MdxCompileOptions, MdxCompiler, MdxSource } from './compiler.js';
|
|
2
|
+
export { HeadingIdPluginOptions, headingIdPlugin } from './plugins/heading-id/plugin.js';
|
|
3
|
+
export { SyntaxHighlightPluginOptions, syntaxHighlightPlugin } from './plugins/syntax-highlight/plugin.js';
|
|
4
|
+
export { MdxTreeProcessor, treeProcessorPlugin } from './plugins/tree-processor/plugin.js';
|
|
5
|
+
export { removeImportsExportsPlugin } from './plugins/remove-imports-exports.js';
|
|
6
|
+
export { Element as HastElement, Node as HastNode } from 'hast';
|
|
7
|
+
export { default as remarkFrontmatterPlugin } from 'remark-frontmatter';
|
|
8
|
+
export { default as remarkGfmPlugin } from 'remark-gfm';
|
|
9
|
+
import '@mdx-js/mdx';
|
|
10
|
+
import 'unified';
|
|
11
|
+
import 'zod';
|
|
12
|
+
import 'shiki';
|
|
13
|
+
import '@shikijs/transformers';
|
package/dist/mod.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Plugin } from 'unified';
|
|
2
|
+
import { Node } from 'hast';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Options for {@linkcode headingIdPlugin}.
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
interface HeadingIdPluginOptions {
|
|
7
8
|
/** Prefix for title slugs. */
|
|
8
9
|
prefix?: string;
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* A rehype plugin that adds IDs to heading tags.
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
|
+
declare const headingIdPlugin: Plugin<[
|
|
14
15
|
HeadingIdPluginOptions?
|
|
15
|
-
],
|
|
16
|
+
], Node, Node>;
|
|
17
|
+
|
|
18
|
+
export { type HeadingIdPluginOptions, headingIdPlugin };
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import GithubSlugger from "github-slugger";
|
|
2
2
|
import { toString as hastToString } from "hast-util-to-string";
|
|
3
3
|
import { visit } from "unist-util-visit";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
const headingIdPlugin = ({ prefix } = {}) => {
|
|
5
|
+
const slugger = new GithubSlugger();
|
|
6
|
+
return (tree) => {
|
|
7
|
+
slugger.reset();
|
|
8
|
+
visit(
|
|
9
|
+
tree,
|
|
10
|
+
"element",
|
|
11
|
+
function visitor(node, index, parent) {
|
|
12
|
+
if (!parent || index === null || !node.tagName.startsWith("h")) return;
|
|
13
|
+
const id = (prefix ?? "") + slugger.slug(hastToString(node));
|
|
14
|
+
node.properties.id = id;
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
return tree;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
headingIdPlugin
|
|
19
22
|
};
|
package/dist/plugins/mod.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
1
|
+
export { HeadingIdPluginOptions, headingIdPlugin } from './heading-id/plugin.js';
|
|
2
|
+
export { SyntaxHighlightPluginOptions, syntaxHighlightPlugin } from './syntax-highlight/plugin.js';
|
|
3
|
+
export { MdxTreeProcessor, treeProcessorPlugin } from './tree-processor/plugin.js';
|
|
4
|
+
export { removeImportsExportsPlugin } from './remove-imports-exports.js';
|
|
5
|
+
import 'unified';
|
|
6
|
+
import 'hast';
|
|
7
|
+
import 'shiki';
|
|
8
|
+
import '@shikijs/transformers';
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Plugin } from 'unified';
|
|
2
|
+
import { Node } from 'hast';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* A remark plugin which removes all import and export statements.
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
declare const removeImportsExportsPlugin: Plugin<[
|
|
7
8
|
unknown
|
|
8
|
-
],
|
|
9
|
+
], Node, Node>;
|
|
10
|
+
|
|
11
|
+
export { removeImportsExportsPlugin };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { remove } from "unist-util-remove";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
const removeImportsExportsPlugin = () => {
|
|
3
|
+
return (tree) => {
|
|
4
|
+
remove(tree, "mdxjsEsm");
|
|
5
|
+
return tree;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
removeImportsExportsPlugin
|
|
10
10
|
};
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { NumericRange } from '@temelj/iterator';
|
|
2
|
+
import { Element } from 'hast';
|
|
3
|
+
|
|
4
|
+
interface MdxCodeMeta {
|
|
4
5
|
highlight?: MdxCodeMetaHighlightLine;
|
|
5
6
|
showLineNumbers?: MdxCodeMetaLineNumbers;
|
|
6
7
|
commandLine?: MdxCodeMetaCommandLine;
|
|
7
8
|
fileName?: string;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
+
type MdxCodeMetaHighlightLine = {
|
|
10
11
|
lineRange: NumericRange;
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
+
type MdxCodeMetaLineNumbers = {
|
|
13
14
|
lineRange: NumericRange;
|
|
14
15
|
};
|
|
15
|
-
|
|
16
|
+
type MdxCodeMetaCommandLine = {
|
|
16
17
|
commandRange: NumericRange;
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
+
declare function extractCodeMeta(node: Element): MdxCodeMeta;
|
|
20
|
+
|
|
21
|
+
export { type MdxCodeMeta, type MdxCodeMetaCommandLine, type MdxCodeMetaHighlightLine, type MdxCodeMetaLineNumbers, extractCodeMeta };
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import { parseNumericRange } from "@temelj/iterator";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
function extractCodeMeta(node) {
|
|
4
|
+
const meta = node?.data?.meta ?? node?.properties?.metastring ?? "";
|
|
5
|
+
return parseMetaString(meta);
|
|
6
6
|
}
|
|
7
7
|
const metaSchema = z.object({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
highlight: z.optional(z.string()),
|
|
9
|
+
showLineNumbers: z.optional(z.union([z.boolean(), z.string()])),
|
|
10
|
+
commandLine: z.optional(z.union([z.boolean(), z.string()])),
|
|
11
|
+
fileName: z.optional(z.string())
|
|
12
12
|
});
|
|
13
13
|
function parseMetaString(meta) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
let raw;
|
|
15
|
+
try {
|
|
16
|
+
raw = JSON.parse(meta.trim());
|
|
17
|
+
} catch {
|
|
18
|
+
return {};
|
|
19
|
+
}
|
|
20
|
+
const parsed = metaSchema.parse(raw);
|
|
21
|
+
const options = {};
|
|
22
|
+
if (parsed.highlight !== void 0) {
|
|
23
|
+
options.highlight = { lineRange: parseNumericRange(parsed.highlight) };
|
|
24
|
+
}
|
|
25
|
+
if (parsed.showLineNumbers !== void 0) {
|
|
26
|
+
if (typeof parsed.showLineNumbers === "string") {
|
|
27
|
+
options.showLineNumbers = {
|
|
28
|
+
lineRange: parseNumericRange(parsed.showLineNumbers)
|
|
29
|
+
};
|
|
30
|
+
} else if (parsed.showLineNumbers) {
|
|
31
|
+
options.showLineNumbers = { lineRange: [] };
|
|
17
32
|
}
|
|
18
|
-
|
|
19
|
-
|
|
33
|
+
}
|
|
34
|
+
if (parsed.commandLine !== void 0) {
|
|
35
|
+
if (typeof parsed.commandLine === "string") {
|
|
36
|
+
options.commandLine = {
|
|
37
|
+
commandRange: parseNumericRange(parsed.commandLine)
|
|
38
|
+
};
|
|
39
|
+
} else if (parsed.commandLine) {
|
|
40
|
+
options.commandLine = { commandRange: [] };
|
|
20
41
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (parsed.showLineNumbers !== undefined) {
|
|
27
|
-
if (typeof parsed.showLineNumbers === "string") {
|
|
28
|
-
options.showLineNumbers = {
|
|
29
|
-
lineRange: parseNumericRange(parsed.showLineNumbers),
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
else if (parsed.showLineNumbers) {
|
|
33
|
-
options.showLineNumbers = { lineRange: [] };
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
if (parsed.commandLine !== undefined) {
|
|
37
|
-
if (typeof parsed.commandLine === "string") {
|
|
38
|
-
options.commandLine = {
|
|
39
|
-
commandRange: parseNumericRange(parsed.commandLine),
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
else if (parsed.commandLine) {
|
|
43
|
-
options.commandLine = { commandRange: [] };
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
if (parsed.fileName !== undefined) {
|
|
47
|
-
options.fileName = parsed.fileName.trim();
|
|
48
|
-
}
|
|
49
|
-
return options;
|
|
42
|
+
}
|
|
43
|
+
if (parsed.fileName !== void 0) {
|
|
44
|
+
options.fileName = parsed.fileName.trim();
|
|
45
|
+
}
|
|
46
|
+
return options;
|
|
50
47
|
}
|
|
48
|
+
export {
|
|
49
|
+
extractCodeMeta
|
|
50
|
+
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { CodeToHastOptions, BundledLanguage, BundledTheme } from 'shiki';
|
|
2
|
+
import { TransformerNotationHighlightOptions } from '@shikijs/transformers';
|
|
3
|
+
import { Plugin } from 'unified';
|
|
4
|
+
import { Node } from 'hast';
|
|
5
|
+
|
|
5
6
|
type ShikiHastOptions = Partial<CodeToHastOptions<BundledLanguage, BundledTheme>>;
|
|
6
7
|
type SyntaxDataAttribute = "source-code" | "language" | "line-count";
|
|
7
8
|
/**
|
|
8
9
|
* Options for {@linkcode syntaxHighlightPlugin}.
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
|
+
interface SyntaxHighlightPluginOptions {
|
|
11
12
|
/**
|
|
12
13
|
* Include these data attributes on the `<pre>` element.
|
|
13
14
|
* These might be useful to have when building custom code components.
|
|
@@ -50,7 +51,8 @@ export interface SyntaxHighlightPluginOptions {
|
|
|
50
51
|
/**
|
|
51
52
|
* A plugin that highlights code blocks using Shiki.
|
|
52
53
|
*/
|
|
53
|
-
|
|
54
|
+
declare const syntaxHighlightPlugin: Plugin<[
|
|
54
55
|
SyntaxHighlightPluginOptions?
|
|
55
|
-
],
|
|
56
|
-
|
|
56
|
+
], Node, Node>;
|
|
57
|
+
|
|
58
|
+
export { type SyntaxHighlightPluginOptions, syntaxHighlightPlugin };
|