@devries-cameron20 / composio Mirror · read-only / commits / 287a5b981
Fork 0

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

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 22, 10:45 UTC

feat(docs): improve AI-friendly markdown output

- Strip twoslash annotations (// ---cut---, // @errors, etc.) from code blocks - these are for type-checking, not useful for AI agents - Add navigation footer with links to llms.txt, examples, and API reference - similar to Vercel's changelog approach Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Sushmithamallesh committed Feb 4, 2026 at 16:32 UTC 287a5b9815dec27ff0607175bf1eaaeccae689c9
1 file changed +17 -1
docs/lib/source.ts
+17 -1
@@ -278,6 +278,18 @@ export function mdxToCleanMarkdown(content: string): string {
278 // Clean up excessive newlines
279 result = result.replace(/\n{3,}/g, '\n\n');
280
281 + // Strip twoslash annotations from code blocks (used for type-checking, not useful for AI)
282 + // These include: // ---cut---, // @errors, // ^?, // @noErrors, etc.
283 + result = result.replace(/^\/\/\s*---cut---.*$/gm, '');
284 + result = result.replace(/^\/\/\s*@errors?:.*$/gm, '');
285 + result = result.replace(/^\/\/\s*@noErrors.*$/gm, '');
286 + result = result.replace(/^\/\/\s*@filename:.*$/gm, '');
287 + result = result.replace(/^\/\/\s*@highlight.*$/gm, '');
288 + result = result.replace(/^\/\/\s*\^[\?\!].*$/gm, ''); // ^? and ^! hover annotations
289 +
290 + // Clean up any resulting empty lines in code blocks
291 + result = result.replace(/\n{3,}/g, '\n\n');
292 +
293 return result.trim();
294 }
295
@@ -314,7 +326,11 @@ ${page.data.description || ''}`;
326
327 return `# ${page.data.title} (${page.url})
328
317 -${cleanContent}`;
329 +${cleanContent}
330 +
331 +---
332 +
333 +📚 **More documentation:** [View all docs](https://docs.composio.dev/llms.txt) | [Examples](https://docs.composio.dev/llms.mdx/examples) | [API Reference](https://docs.composio.dev/llms.mdx/reference)`;
334 }
335
336 export function formatDate(dateStr: string): string {