Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

fix(docs): Enable includeProcessedMarkdown for all sources

sohamganatra7b7515ca2390
diff --git a/docs/lib/source.ts b/docs/lib/source.ts
index 02298457f..4bfe3a392 100644
--- a/docs/lib/source.ts
+++ b/docs/lib/source.ts
@@ -176,7 +176,6 @@ function mdxToCleanMarkdown(content: string): string {
}
export async function getLLMText(page: InferPageType<typeof source>) {
- // Use 'processed' mode since that's what includeProcessedMarkdown enables
// Fall back to description if getText is not available
if (typeof page.data.getText !== 'function') {
return `# ${page.data.title} (${page.url})
@@ -184,7 +183,27 @@ export async function getLLMText(page: InferPageType<typeof source>) {
${page.data.description || ''}`;
}
- const content = await page.data.getText('processed');
+ // Try 'processed' mode first (works in serverless), then 'raw' (works locally)
+ // Both can fail in different environments, so handle gracefully
+ let content: string | null = null;
+
+ try {
+ content = await page.data.getText('processed');
+ } catch (e) {
+ console.error('getText(processed) failed:', e);
+ try {
+ content = await page.data.getText('raw');
+ } catch (e2) {
+ console.error('getText(raw) also failed:', e2);
+ }
+ }
+
+ if (!content) {
+ return `# ${page.data.title} (${page.url})
+
+${page.data.description || ''}`;
+ }
+
const cleanContent = mdxToCleanMarkdown(content);
return `# ${page.data.title} (${page.url})
diff --git a/docs/source.config.ts b/docs/source.config.ts
index 689e51341..affccef73 100644
--- a/docs/source.config.ts
+++ b/docs/source.config.ts
@@ -37,6 +37,9 @@ export const reference = defineDocs({
dir: 'content/reference',
docs: {
schema: docsSchema,
+ postprocess: {
+ includeProcessedMarkdown: true,
+ },
mdxOptions: applyMdxPreset({
rehypeCodeOptions: {
themes: {
@@ -56,6 +59,9 @@ export const examples = defineDocs({
dir: 'content/examples',
docs: {
schema: docsSchema,
+ postprocess: {
+ includeProcessedMarkdown: true,
+ },
},
meta: {
schema: metaSchema,
@@ -66,6 +72,9 @@ export const toolkits = defineDocs({
dir: 'content/toolkits',
docs: {
schema: docsSchema,
+ postprocess: {
+ includeProcessedMarkdown: true,
+ },
},
meta: {
schema: metaSchema,