fumadocs-core 14.6.3 → 14.6.4
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/get-toc-Cr2URuiP.d.ts +25 -0
- package/dist/server/index.d.ts +3 -1
- package/dist/server/index.js +7 -1
- package/dist/toc.d.ts +3 -1
- package/package.json +2 -1
- package/dist/get-toc-Dm1yr2Gr.d.ts +0 -16
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PluggableList } from 'unified';
|
|
3
|
+
import { Compatible } from 'vfile';
|
|
4
|
+
|
|
5
|
+
interface TOCItemType {
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
url: string;
|
|
8
|
+
depth: number;
|
|
9
|
+
}
|
|
10
|
+
type TableOfContents = TOCItemType[];
|
|
11
|
+
/**
|
|
12
|
+
* Get Table of Contents from markdown/mdx document (using remark)
|
|
13
|
+
*
|
|
14
|
+
* @param content - Markdown content or file
|
|
15
|
+
*/
|
|
16
|
+
declare function getTableOfContents(content: Compatible): TableOfContents;
|
|
17
|
+
/**
|
|
18
|
+
* Get Table of Contents from markdown/mdx document (using remark)
|
|
19
|
+
*
|
|
20
|
+
* @param content - Markdown content or file
|
|
21
|
+
* @param remarkPlugins - remark plugins to be applied first
|
|
22
|
+
*/
|
|
23
|
+
declare function getTableOfContents(content: Compatible, remarkPlugins: PluggableList): Promise<TableOfContents>;
|
|
24
|
+
|
|
25
|
+
export { type TableOfContents as T, type TOCItemType as a, getTableOfContents as g };
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as TOCItemType, T as TableOfContents, g as getTableOfContents } from '../get-toc-
|
|
1
|
+
export { a as TOCItemType, T as TableOfContents, g as getTableOfContents } from '../get-toc-Cr2URuiP.js';
|
|
2
2
|
import { N as Node, I as Item, R as Root } from '../page-tree-r8qjoUla.js';
|
|
3
3
|
export { p as PageTree } from '../page-tree-r8qjoUla.js';
|
|
4
4
|
export { S as SortedResult } from '../types-Ch8gnVgO.js';
|
|
@@ -7,6 +7,8 @@ import { NextRequest } from 'next/server';
|
|
|
7
7
|
import { LoaderOutput, LoaderConfig, InferPageType } from '../source/index.js';
|
|
8
8
|
export { H as HighlightOptions, c as createStyleTransformer, h as highlight } from '../shiki-CNmCR8Td.js';
|
|
9
9
|
import 'react';
|
|
10
|
+
import 'unified';
|
|
11
|
+
import 'vfile';
|
|
10
12
|
import '../config-inq6kP6y.js';
|
|
11
13
|
import 'shiki';
|
|
12
14
|
import 'shiki/themes';
|
package/dist/server/index.js
CHANGED
|
@@ -9,7 +9,13 @@ import "../chunk-MLKGABMK.js";
|
|
|
9
9
|
|
|
10
10
|
// src/server/get-toc.ts
|
|
11
11
|
import { remark } from "remark";
|
|
12
|
-
function getTableOfContents(content) {
|
|
12
|
+
function getTableOfContents(content, remarkPlugins) {
|
|
13
|
+
if (remarkPlugins) {
|
|
14
|
+
return remark().use(remarkPlugins).use(remarkHeading).process(content).then((result2) => {
|
|
15
|
+
if ("toc" in result2.data) return result2.data.toc;
|
|
16
|
+
return [];
|
|
17
|
+
});
|
|
18
|
+
}
|
|
13
19
|
const result = remark().use(remarkHeading).processSync(content);
|
|
14
20
|
if ("toc" in result.data) return result.data.toc;
|
|
15
21
|
return [];
|
package/dist/toc.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, RefObject, AnchorHTMLAttributes } from 'react';
|
|
3
|
-
import { T as TableOfContents } from './get-toc-
|
|
3
|
+
import { T as TableOfContents } from './get-toc-Cr2URuiP.js';
|
|
4
|
+
import 'unified';
|
|
5
|
+
import 'vfile';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* The estimated active heading ID
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-core",
|
|
3
|
-
"version": "14.6.
|
|
3
|
+
"version": "14.6.4",
|
|
4
4
|
"description": "The library for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -108,6 +108,7 @@
|
|
|
108
108
|
"shiki-transformers": "^1.0.1",
|
|
109
109
|
"typescript": "^5.7.2",
|
|
110
110
|
"unified": "^11.0.5",
|
|
111
|
+
"vfile": "^6.0.3",
|
|
111
112
|
"eslint-config-custom": "0.0.0",
|
|
112
113
|
"tsconfig": "0.0.0"
|
|
113
114
|
},
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
interface TOCItemType {
|
|
4
|
-
title: ReactNode;
|
|
5
|
-
url: string;
|
|
6
|
-
depth: number;
|
|
7
|
-
}
|
|
8
|
-
type TableOfContents = TOCItemType[];
|
|
9
|
-
/**
|
|
10
|
-
* Get Table of Contents from markdown/mdx document (using remark)
|
|
11
|
-
*
|
|
12
|
-
* @param content - Markdown content
|
|
13
|
-
*/
|
|
14
|
-
declare function getTableOfContents(content: string): TableOfContents;
|
|
15
|
-
|
|
16
|
-
export { type TableOfContents as T, type TOCItemType as a, getTableOfContents as g };
|