fumadocs-core 15.7.2 → 15.7.3
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/{chunk-Y2774T3B.js → chunk-QMATWJ5F.js} +6 -7
- package/dist/mdx-plugins/index.d.ts +5 -25
- package/dist/mdx-plugins/index.js +60 -95
- package/dist/remark-code-tab-DmyIyi6m.d.ts +57 -0
- package/dist/{remark-structure-DVje0Sib.d.ts → remark-structure-DkCXCzpD.d.ts} +5 -0
- package/dist/search/algolia.d.ts +1 -1
- package/dist/search/client.d.ts +1 -1
- package/dist/search/orama-cloud.d.ts +2 -2
- package/dist/search/server.d.ts +1 -1
- package/dist/server/index.js +1 -1
- package/package.json +3 -3
- package/dist/remark-heading-BPCoYwjn.d.ts +0 -31
|
@@ -24,25 +24,24 @@ function remarkHeading({
|
|
|
24
24
|
visit(root, "heading", (heading) => {
|
|
25
25
|
heading.data ||= {};
|
|
26
26
|
heading.data.hProperties ||= {};
|
|
27
|
-
|
|
27
|
+
const props = heading.data.hProperties;
|
|
28
28
|
const lastNode = heading.children.at(-1);
|
|
29
|
-
if (
|
|
29
|
+
if (lastNode?.type === "text" && customId) {
|
|
30
30
|
const match = regex.exec(lastNode.value);
|
|
31
31
|
if (match?.[1]) {
|
|
32
|
-
id = match[1];
|
|
32
|
+
props.id = match[1];
|
|
33
33
|
lastNode.value = lastNode.value.slice(0, match.index);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
let flattened = null;
|
|
37
|
-
if (!id) {
|
|
37
|
+
if (!props.id) {
|
|
38
38
|
flattened ??= flattenNode(heading);
|
|
39
|
-
id = defaultSlug ? defaultSlug(root, heading, flattened) : slugger.slug(flattened);
|
|
39
|
+
props.id = defaultSlug ? defaultSlug(root, heading, flattened) : slugger.slug(flattened);
|
|
40
40
|
}
|
|
41
|
-
heading.data.hProperties.id = id;
|
|
42
41
|
if (generateToc) {
|
|
43
42
|
toc.push({
|
|
44
43
|
title: flattened ?? flattenNode(heading),
|
|
45
|
-
url: `#${id}`,
|
|
44
|
+
url: `#${props.id}`,
|
|
46
45
|
depth: heading.depth
|
|
47
46
|
});
|
|
48
47
|
}
|
|
@@ -3,10 +3,10 @@ import { Root } from 'hast';
|
|
|
3
3
|
import { RehypeShikiOptions } from '@shikijs/rehype';
|
|
4
4
|
import { Processor, Transformer } from 'unified';
|
|
5
5
|
import { ShikiTransformer } from 'shiki';
|
|
6
|
-
import { Root as Root$1,
|
|
7
|
-
export { a as StructureOptions, S as StructuredData, r as remarkStructure, s as structure } from '../remark-structure-
|
|
8
|
-
export { R as RemarkHeadingOptions, r as remarkHeading } from '../remark-
|
|
9
|
-
import {
|
|
6
|
+
import { Root as Root$1, BlockContent, Text } from 'mdast';
|
|
7
|
+
export { a as StructureOptions, S as StructuredData, r as remarkStructure, s as structure } from '../remark-structure-DkCXCzpD.js';
|
|
8
|
+
export { a as RemarkCodeTabOptions, R as RemarkHeadingOptions, b as remarkCodeTab, r as remarkHeading } from '../remark-code-tab-DmyIyi6m.js';
|
|
9
|
+
import { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx-jsx';
|
|
10
10
|
|
|
11
11
|
interface CodeBlockIcon {
|
|
12
12
|
viewBox: string;
|
|
@@ -122,26 +122,6 @@ interface RehypeTocOptions {
|
|
|
122
122
|
}
|
|
123
123
|
declare function rehypeToc(this: Processor, { exportToc }?: RehypeTocOptions): Transformer<Root, Root>;
|
|
124
124
|
|
|
125
|
-
type TabType = keyof typeof Types;
|
|
126
|
-
interface RemarkCodeTabOptions {
|
|
127
|
-
Tabs?: TabType;
|
|
128
|
-
/**
|
|
129
|
-
* Parse MDX in tab values
|
|
130
|
-
*
|
|
131
|
-
* @defaultValue false
|
|
132
|
-
*/
|
|
133
|
-
parseMdx?: boolean;
|
|
134
|
-
}
|
|
135
|
-
declare const Types: {
|
|
136
|
-
CodeBlockTabs: {
|
|
137
|
-
convert(processor: Processor, nodes: Code[], withMdx?: boolean, withParent?: boolean): MdxJsxFlowElement;
|
|
138
|
-
};
|
|
139
|
-
Tabs: {
|
|
140
|
-
convert(processor: Processor, nodes: Code[], withMdx?: boolean, withParent?: boolean): MdxJsxFlowElement;
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
|
-
declare function remarkCodeTab(this: Processor, options?: RemarkCodeTabOptions): Transformer<Root$1, Root$1>;
|
|
144
|
-
|
|
145
125
|
interface RemarkStepsOptions {
|
|
146
126
|
/**
|
|
147
127
|
* Class name for steps container
|
|
@@ -213,4 +193,4 @@ interface CodeBlockAttributes<Name extends string = string> {
|
|
|
213
193
|
*/
|
|
214
194
|
declare function parseCodeBlockAttributes<Name extends string = string>(meta: string, allowedNames?: Name[]): CodeBlockAttributes<Name>;
|
|
215
195
|
|
|
216
|
-
export { type CodeBlockAttributes, type CodeBlockIcon, type CodeBlockTabsOptions, type RehypeCodeOptions, type RehypeTocOptions, type RemarkAdmonitionOptions, type
|
|
196
|
+
export { type CodeBlockAttributes, type CodeBlockIcon, type CodeBlockTabsOptions, type RehypeCodeOptions, type RehypeTocOptions, type RemarkAdmonitionOptions, type RemarkImageOptions, type RemarkNpmOptions, type RemarkStepsOptions, generateCodeBlockTabs, parseCodeBlockAttributes, rehypeCode, rehypeCodeDefaultOptions, rehypeToc, remarkAdmonition, remarkImage, remarkNpm, remarkSteps, transformerIcon, transformerTab };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
flattenNode,
|
|
3
3
|
remarkHeading
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-QMATWJ5F.js";
|
|
5
5
|
import {
|
|
6
6
|
joinPath,
|
|
7
7
|
slash
|
|
@@ -318,7 +318,8 @@ function rehypeCode(_options = {}) {
|
|
|
318
318
|
options.experimentalJSEngine ? "js" : "oniguruma",
|
|
319
319
|
{
|
|
320
320
|
themes: "themes" in options ? Object.values(options.themes).filter(Boolean) : [options.theme],
|
|
321
|
-
langs: options.langs ?? (options.lazy ? ["ts", "tsx"] : Object.keys(bundledLanguages))
|
|
321
|
+
langs: options.langs ?? (options.lazy ? ["ts", "tsx"] : Object.keys(bundledLanguages)),
|
|
322
|
+
langAlias: options.langAlias
|
|
322
323
|
}
|
|
323
324
|
);
|
|
324
325
|
const transformer = highlighter.then(
|
|
@@ -569,7 +570,6 @@ import Slugger from "github-slugger";
|
|
|
569
570
|
import { remark } from "remark";
|
|
570
571
|
import remarkGfm from "remark-gfm";
|
|
571
572
|
import { visit as visit2 } from "unist-util-visit";
|
|
572
|
-
var slugger = new Slugger();
|
|
573
573
|
function remarkStructure({
|
|
574
574
|
types = [
|
|
575
575
|
"heading",
|
|
@@ -583,6 +583,7 @@ function remarkStructure({
|
|
|
583
583
|
return ["TypeTable", "Callout"].includes(node.name);
|
|
584
584
|
}
|
|
585
585
|
} = {}) {
|
|
586
|
+
const slugger = new Slugger();
|
|
586
587
|
if (Array.isArray(allowedMdxAttributes)) {
|
|
587
588
|
const arr = allowedMdxAttributes;
|
|
588
589
|
allowedMdxAttributes = (_node, attribute) => attribute.type === "mdxJsxAttribute" && arr.includes(attribute.name);
|
|
@@ -594,7 +595,7 @@ function remarkStructure({
|
|
|
594
595
|
return (node, file) => {
|
|
595
596
|
slugger.reset();
|
|
596
597
|
const data = { contents: [], headings: [] };
|
|
597
|
-
let lastHeading
|
|
598
|
+
let lastHeading;
|
|
598
599
|
if (file.data.frontmatter) {
|
|
599
600
|
const frontmatter = file.data.frontmatter;
|
|
600
601
|
if (frontmatter._openapi?.structuredData) {
|
|
@@ -747,7 +748,7 @@ function rehypeToc({ exportToc = true } = {}) {
|
|
|
747
748
|
const output = [];
|
|
748
749
|
visit4(tree, ["h1", "h2", "h3", "h4", "h5", "h6"], (element) => {
|
|
749
750
|
const id = element.properties.id;
|
|
750
|
-
if (
|
|
751
|
+
if (typeof id !== "string") return "skip";
|
|
751
752
|
let isTocOnly = false;
|
|
752
753
|
const last = element.children.at(-1);
|
|
753
754
|
if (last?.type === "text" && last.value.endsWith(TocOnlyTag)) {
|
|
@@ -867,7 +868,6 @@ function rehypeToc({ exportToc = true } = {}) {
|
|
|
867
868
|
|
|
868
869
|
// src/mdx-plugins/remark-code-tab.ts
|
|
869
870
|
import { visit as visit5 } from "unist-util-visit";
|
|
870
|
-
var TabRegex = /tab="(.+?)"/;
|
|
871
871
|
var Tabs = {
|
|
872
872
|
convert(processor, nodes, withMdx = false, withParent = true) {
|
|
873
873
|
const names = processTabValue(nodes);
|
|
@@ -976,62 +976,27 @@ var Tabs = {
|
|
|
976
976
|
var CodeBlockTabs = {
|
|
977
977
|
convert(processor, nodes, withMdx = false, withParent = true) {
|
|
978
978
|
const names = processTabValue(nodes);
|
|
979
|
-
const
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
type: "text",
|
|
1001
|
-
value: name
|
|
1002
|
-
}
|
|
1003
|
-
]
|
|
1004
|
-
};
|
|
1005
|
-
})
|
|
1006
|
-
},
|
|
1007
|
-
...nodes.map((node, i) => {
|
|
1008
|
-
return {
|
|
1009
|
-
type: "mdxJsxFlowElement",
|
|
1010
|
-
name: "CodeBlockTab",
|
|
1011
|
-
attributes: [
|
|
1012
|
-
{
|
|
1013
|
-
type: "mdxJsxAttribute",
|
|
1014
|
-
name: "value",
|
|
1015
|
-
value: names[i]
|
|
1016
|
-
}
|
|
1017
|
-
],
|
|
1018
|
-
children: [node]
|
|
1019
|
-
};
|
|
1020
|
-
})
|
|
1021
|
-
];
|
|
1022
|
-
if (!withParent) return createFragment(children);
|
|
1023
|
-
return {
|
|
1024
|
-
type: "mdxJsxFlowElement",
|
|
1025
|
-
name: "CodeBlockTabs",
|
|
1026
|
-
attributes: [
|
|
1027
|
-
{
|
|
1028
|
-
type: "mdxJsxAttribute",
|
|
1029
|
-
name: "defaultValue",
|
|
1030
|
-
value: names[0]
|
|
1031
|
-
}
|
|
1032
|
-
],
|
|
1033
|
-
children
|
|
1034
|
-
};
|
|
979
|
+
const node = generateCodeBlockTabs({
|
|
980
|
+
defaultValue: names[0],
|
|
981
|
+
triggers: names.map((name) => ({
|
|
982
|
+
value: name,
|
|
983
|
+
children: [
|
|
984
|
+
withMdx ? (
|
|
985
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- needed
|
|
986
|
+
mdxToAst(processor, name)
|
|
987
|
+
) : {
|
|
988
|
+
type: "text",
|
|
989
|
+
value: name
|
|
990
|
+
}
|
|
991
|
+
]
|
|
992
|
+
})),
|
|
993
|
+
tabs: nodes.map((node2, i) => ({
|
|
994
|
+
value: names[i],
|
|
995
|
+
children: [node2]
|
|
996
|
+
}))
|
|
997
|
+
});
|
|
998
|
+
if (!withParent) return createFragment(node.children);
|
|
999
|
+
return node;
|
|
1035
1000
|
}
|
|
1036
1001
|
};
|
|
1037
1002
|
var Types = {
|
|
@@ -1041,58 +1006,58 @@ var Types = {
|
|
|
1041
1006
|
function remarkCodeTab(options = {}) {
|
|
1042
1007
|
const { parseMdx = false, Tabs: Tabs2 = "CodeBlockTabs" } = options;
|
|
1043
1008
|
return (tree) => {
|
|
1009
|
+
const ignored = /* @__PURE__ */ new WeakSet();
|
|
1044
1010
|
visit5(tree, (node) => {
|
|
1045
|
-
if (!("children" in node)) return;
|
|
1046
|
-
let start = -1;
|
|
1047
|
-
let i = 0;
|
|
1011
|
+
if (!("children" in node) || ignored.has(node)) return "skip";
|
|
1048
1012
|
let localTabs = Tabs2;
|
|
1049
1013
|
let localParseMdx = parseMdx;
|
|
1050
1014
|
let withParent = true;
|
|
1051
1015
|
if (node.type === "mdxJsxFlowElement" && node.name && node.name in Types) {
|
|
1052
1016
|
withParent = false;
|
|
1053
1017
|
localTabs = node.name;
|
|
1054
|
-
if (node.name === "Tabs") {
|
|
1018
|
+
if (node.name === "Tabs" && localParseMdx) {
|
|
1055
1019
|
localParseMdx = node.attributes.every(
|
|
1056
1020
|
(attribute) => attribute.type !== "mdxJsxAttribute" || attribute.name !== "items"
|
|
1057
1021
|
);
|
|
1058
1022
|
}
|
|
1059
1023
|
}
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
if (
|
|
1064
|
-
|
|
1024
|
+
let start = -1;
|
|
1025
|
+
let end = 0;
|
|
1026
|
+
const close = () => {
|
|
1027
|
+
if (start === -1 || start === end) return;
|
|
1028
|
+
const replacement = Types[localTabs].convert(
|
|
1029
|
+
this,
|
|
1030
|
+
node.children.slice(start, end),
|
|
1031
|
+
localParseMdx,
|
|
1032
|
+
withParent
|
|
1033
|
+
);
|
|
1034
|
+
ignored.add(replacement);
|
|
1035
|
+
node.children.splice(start, end - start, replacement);
|
|
1036
|
+
end = start;
|
|
1037
|
+
start = -1;
|
|
1038
|
+
};
|
|
1039
|
+
for (; end < node.children.length; end++) {
|
|
1040
|
+
const child = node.children[end];
|
|
1041
|
+
if (child.type !== "code" || !child.meta) {
|
|
1042
|
+
close();
|
|
1043
|
+
continue;
|
|
1065
1044
|
}
|
|
1066
|
-
const
|
|
1067
|
-
if (
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
const replacement = Types[localTabs].convert(
|
|
1071
|
-
this,
|
|
1072
|
-
targets,
|
|
1073
|
-
localParseMdx,
|
|
1074
|
-
withParent
|
|
1075
|
-
);
|
|
1076
|
-
node.children.splice(start, end - start, replacement);
|
|
1077
|
-
if (isLast) break;
|
|
1078
|
-
i = start + 1;
|
|
1079
|
-
start = -1;
|
|
1080
|
-
} else {
|
|
1081
|
-
i++;
|
|
1045
|
+
const meta = parseCodeBlockAttributes(child.meta, ["tab"]);
|
|
1046
|
+
if (!meta.attributes.tab) {
|
|
1047
|
+
close();
|
|
1048
|
+
continue;
|
|
1082
1049
|
}
|
|
1050
|
+
if (start === -1) start = end;
|
|
1051
|
+
child.meta = meta.rest;
|
|
1052
|
+
child.data ??= {};
|
|
1053
|
+
child.data.tab = meta.attributes.tab;
|
|
1083
1054
|
}
|
|
1055
|
+
close();
|
|
1084
1056
|
});
|
|
1085
1057
|
};
|
|
1086
1058
|
}
|
|
1087
1059
|
function processTabValue(nodes) {
|
|
1088
|
-
return nodes.map((node, i) => {
|
|
1089
|
-
let title = `Tab ${i + 1}`;
|
|
1090
|
-
node.meta = node.meta?.replace(TabRegex, (_, value) => {
|
|
1091
|
-
title = value;
|
|
1092
|
-
return "";
|
|
1093
|
-
});
|
|
1094
|
-
return title;
|
|
1095
|
-
});
|
|
1060
|
+
return nodes.map((node, i) => node.data?.tab ?? `Tab ${i + 1}`);
|
|
1096
1061
|
}
|
|
1097
1062
|
function mdxToAst(processor, name) {
|
|
1098
1063
|
const node = processor.parse(name);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Root, Heading, Code } from 'mdast';
|
|
2
|
+
import { Transformer, Processor } from 'unified';
|
|
3
|
+
import { MdxJsxFlowElement } from 'mdast-util-mdx-jsx';
|
|
4
|
+
|
|
5
|
+
declare module 'mdast' {
|
|
6
|
+
interface HeadingData extends Data {
|
|
7
|
+
hProperties?: {
|
|
8
|
+
id?: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
interface RemarkHeadingOptions {
|
|
13
|
+
slug?: (root: Root, heading: Heading, text: string) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Allow custom headings ids
|
|
16
|
+
*
|
|
17
|
+
* @defaultValue true
|
|
18
|
+
*/
|
|
19
|
+
customId?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Attach an array of `TOCItemType` to `file.data.toc`
|
|
22
|
+
*
|
|
23
|
+
* @defaultValue true
|
|
24
|
+
*/
|
|
25
|
+
generateToc?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Add heading ids and extract TOC
|
|
29
|
+
*/
|
|
30
|
+
declare function remarkHeading({ slug: defaultSlug, customId, generateToc, }?: RemarkHeadingOptions): Transformer<Root, Root>;
|
|
31
|
+
|
|
32
|
+
type TabType = keyof typeof Types;
|
|
33
|
+
interface RemarkCodeTabOptions {
|
|
34
|
+
Tabs?: TabType;
|
|
35
|
+
/**
|
|
36
|
+
* Parse MDX in tab values
|
|
37
|
+
*
|
|
38
|
+
* @defaultValue false
|
|
39
|
+
*/
|
|
40
|
+
parseMdx?: boolean;
|
|
41
|
+
}
|
|
42
|
+
declare module 'mdast' {
|
|
43
|
+
interface CodeData {
|
|
44
|
+
tab?: string;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
declare const Types: {
|
|
48
|
+
CodeBlockTabs: {
|
|
49
|
+
convert(processor: Processor, nodes: Code[], withMdx?: boolean, withParent?: boolean): MdxJsxFlowElement;
|
|
50
|
+
};
|
|
51
|
+
Tabs: {
|
|
52
|
+
convert(processor: Processor, nodes: Code[], withMdx?: boolean, withParent?: boolean): MdxJsxFlowElement;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
declare function remarkCodeTab(this: Processor, options?: RemarkCodeTabOptions): Transformer<Root, Root>;
|
|
56
|
+
|
|
57
|
+
export { type RemarkHeadingOptions as R, type RemarkCodeTabOptions as a, remarkCodeTab as b, remarkHeading as r };
|
package/dist/search/algolia.d.ts
CHANGED
package/dist/search/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnyOrama } from '@orama/orama';
|
|
2
|
-
import '../remark-structure-
|
|
2
|
+
import '../remark-structure-DkCXCzpD.js';
|
|
3
3
|
import { BaseIndex } from './algolia.js';
|
|
4
4
|
import { LiteClient, SearchResponse } from 'algoliasearch/lite';
|
|
5
5
|
import { OramaClient, ClientSearchParams } from '@oramacloud/client';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CloudManager } from '@oramacloud/client';
|
|
2
|
-
import { S as StructuredData } from '../remark-structure-
|
|
3
|
-
import '../remark-
|
|
2
|
+
import { S as StructuredData } from '../remark-structure-DkCXCzpD.js';
|
|
3
|
+
import '../remark-code-tab-DmyIyi6m.js';
|
|
4
4
|
import 'mdast';
|
|
5
5
|
import 'unified';
|
|
6
6
|
import 'mdast-util-mdx-jsx';
|
package/dist/search/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TypedDocument, Orama, Language, RawData, create, SearchParams } from '@orama/orama';
|
|
2
|
-
import { S as StructuredData } from '../remark-structure-
|
|
2
|
+
import { S as StructuredData } from '../remark-structure-DkCXCzpD.js';
|
|
3
3
|
import { S as SortedResult } from '../shared-ORgOfXFw.js';
|
|
4
4
|
export { H as HighlightedText, c as createContentHighlighter } from '../shared-ORgOfXFw.js';
|
|
5
5
|
import { I18nConfig } from '../i18n/index.js';
|
package/dist/server/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-core",
|
|
3
|
-
"version": "15.7.
|
|
3
|
+
"version": "15.7.3",
|
|
4
4
|
"description": "The library for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -131,8 +131,8 @@
|
|
|
131
131
|
"unified": "^11.0.5",
|
|
132
132
|
"vfile": "^6.0.3",
|
|
133
133
|
"waku": "^0.25.0",
|
|
134
|
-
"
|
|
135
|
-
"
|
|
134
|
+
"eslint-config-custom": "0.0.0",
|
|
135
|
+
"tsconfig": "0.0.0"
|
|
136
136
|
},
|
|
137
137
|
"peerDependencies": {
|
|
138
138
|
"@mixedbread/sdk": "^0.19.0",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Root, Heading } from 'mdast';
|
|
2
|
-
import { Transformer } from 'unified';
|
|
3
|
-
|
|
4
|
-
declare module 'mdast' {
|
|
5
|
-
interface HeadingData extends Data {
|
|
6
|
-
hProperties?: {
|
|
7
|
-
id?: string;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
interface RemarkHeadingOptions {
|
|
12
|
-
slug?: (root: Root, heading: Heading, text: string) => string;
|
|
13
|
-
/**
|
|
14
|
-
* Allow custom headings ids
|
|
15
|
-
*
|
|
16
|
-
* @defaultValue true
|
|
17
|
-
*/
|
|
18
|
-
customId?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Attach an array of `TOCItemType` to `file.data.toc`
|
|
21
|
-
*
|
|
22
|
-
* @defaultValue true
|
|
23
|
-
*/
|
|
24
|
-
generateToc?: boolean;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Add heading ids and extract TOC
|
|
28
|
-
*/
|
|
29
|
-
declare function remarkHeading({ slug: defaultSlug, customId, generateToc, }?: RemarkHeadingOptions): Transformer<Root, Root>;
|
|
30
|
-
|
|
31
|
-
export { type RemarkHeadingOptions as R, remarkHeading as r };
|