Skip to content

Commit ca3f4c3

Browse files
committed
llm
1 parent 08c69cb commit ca3f4c3

File tree

3 files changed

+285
-617
lines changed

3 files changed

+285
-617
lines changed

apps/developer-hub/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"clsx": "catalog:",
2929
"fumadocs-core": "catalog:",
3030
"fumadocs-mdx": "catalog:",
31+
"fumadocs-typescript": "^4.0.8",
3132
"fumadocs-ui": "catalog:",
3233
"katex": "catalog:",
3334
"next": "catalog:",
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
// import fs from 'node:fs/promises';
1+
import fs from 'node:fs/promises';
22

3-
// import type { InferPageType } from 'fumadocs-core/source';
4-
// import { remarkInclude } from 'fumadocs-mdx/config';
5-
// import { remark } from 'remark';
6-
// import remarkGfm from 'remark-gfm';
7-
// import remarkMdx from 'remark-mdx';
3+
import type { InferPageType } from 'fumadocs-core/source';
4+
import { remarkInclude } from 'fumadocs-mdx/config';
5+
import { remark } from 'remark';
6+
import remarkGfm from 'remark-gfm';
7+
import remarkMdx from 'remark-mdx';
88

9-
// import { source } from './source';
9+
import { source } from './source';
1010

11-
// const processor = remark()
12-
// .use(remarkMdx)
13-
// .use(remarkInclude)
14-
// .use(remarkGfm)
11+
const processor = remark()
12+
.use(remarkMdx)
13+
.use(remarkInclude)
14+
.use(remarkGfm)
1515

16-
// export async function getLLMText(page: InferPageType<typeof source>) {
17-
// const processed = await processor.process({
18-
// path: page.absolutePath,
19-
// value: await fs.readFile(page.absolutePath, 'utf8'),
20-
// });
16+
export async function getLLMText(page: InferPageType<typeof source>) {
17+
const processed = await processor.process({
18+
path: page.file.path,
19+
value: await fs.readFile(page.file.path, 'utf8'),
20+
});
2121

22-
// // note: it doesn't escape frontmatter, it's up to you.
23-
// return `# ${page.data.title}
24-
// URL: ${page.url}
22+
// note: it doesn't escape frontmatter, it's up to you.
23+
return `# ${page.data.title}
24+
URL: ${page.url}
2525
26-
// ${processed.value}`;
27-
// }
26+
${String(processed.value)}`;
27+
}

0 commit comments

Comments
 (0)