chore(web): test

This commit is contained in:
Aman Varshney
2025-08-12 17:54:14 +05:30
parent 1f36e9effc
commit 16e22726c8
4 changed files with 19 additions and 6 deletions

View File

@@ -1,9 +1,20 @@
import type { InferPageType } from "fumadocs-core/source";
import { remarkInclude } from "fumadocs-mdx/config";
import { remark } from "remark";
import remarkGfm from "remark-gfm";
import remarkMdx from "remark-mdx";
import type { source } from "@/lib/source";
import { remarkInclude } from "fumadocs-mdx/config";
// Avoid importing `source` at runtime to keep bundle small
// import { source } from '@/lib/source';
// import type { InferPageType } from 'fumadocs-core/source';
type LLMPage = {
url: string;
data: {
title: string;
description?: string;
content: string;
_file: { absolutePath: string; path: string };
};
};
const processor = remark()
.use(remarkMdx)
@@ -11,7 +22,7 @@ const processor = remark()
.use(remarkInclude)
.use(remarkGfm);
export async function getLLMText(page: InferPageType<typeof source>) {
export async function getLLMText(page: LLMPage) {
const processed = await processor.process({
path: page.data._file.absolutePath,
value: page.data.content,