-
Notifications
You must be signed in to change notification settings - Fork 95
Add /llms.txt endpoints for LLM-consumable documentation #513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: abernier <76580+abernier@users.noreply.github.com>
|
@copilot le nettoyage des balises jsx marche pas hyper bien, je vois encore les balises fermantes comme |
Co-authored-by: abernier <76580+abernier@users.noreply.github.com>
Fixed in 77ef430. The cleanMarkdown function now uses an iterative approach to remove nested JSX components properly. It repeatedly applies the regex pattern until no more matches are found, which handles cases like |
Co-authored-by: abernier <76580+abernier@users.noreply.github.com>
|
@copilot a la place des appels a des composants React |
Co-authored-by: abernier <76580+abernier@users.noreply.github.com>
Co-authored-by: abernier <76580+abernier@users.noreply.github.com>
Fixed in 85316e5. Now only React components (starting with uppercase) are replaced with Example output:
|
|
oublis le stripping completement on perd trop d'information: laisse les balise on s'en fout pour le moment, c'est mieux que rien @copilot |
Co-authored-by: abernier <76580+abernier@users.noreply.github.com>
Fixed in def4a47. All JSX stripping has been removed. The content now preserves all JSX/MDX tags as-is, including Example output now includes the raw JSX: |
Co-authored-by: abernier <76580+abernier@users.noreply.github.com>
|
@copilot ci still fails reproduce, fix AND check the build is now ok !!! |
Co-authored-by: abernier <76580+abernier@users.noreply.github.com>
Fixed in 182d11d. The TypeScript error was caused by overly specific type annotation for the params. Changed to use Verified:
The build should now pass the TypeScript check. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot still necessary (you added this in a previous commit i think)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot if not, dont forget to update the lock file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in d408942. The remark, remark-mdx, and remark-stringify dependencies were added in commit fad20a3 for JSX stripping but are no longer used after we simplified to keep all JSX tags as-is (commit def4a47). The current implementation only uses basic string operations, so these dependencies are unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already done in d408942. The commit removed the dependencies from package.json and updated pnpm-lock.yaml (21 lines removed). Both files were committed together.
Co-authored-by: abernier <76580+abernier@users.noreply.github.com>
Implementation Complete: /llms.txt endpoints with source file access
/src/app/llms.txt/route.tsfor basic llms.txt endpoint.mdsource URLs for each page/src/app/llms-full.txt/route.tsfor full documentation.mdsource URLs in output/src/app/[...slug].md/route.tsfor serving source filesNew Feature: Raw Source File Access
Each documentation page now has a corresponding
.mdendpoint that serves the raw MDX source file exactly as it appears in the repository:Example:
/authoring/keypoints/authoring/keypoints.md(raw MDX file)Raw MDX Output
The
.mdendpoints return source files completely unchanged:Example
/authoring/keypoints.mdoutput:Updated llms.txt Output
Updated llms-full.txt Output
Benefits
✅ Direct source access - LLMs can fetch raw MDX files
✅ No modification - Files served exactly as written
✅ Original format - YAML frontmatter and JSX preserved
✅ Static generation - All routes pre-generated at build time
✅ Type-safe - Fixed TypeScript compilation with proper Record type
✅ Minimal dependencies - Removed unused remark packages
Technical Details
The route handler uses
Record<string, string | string[]>for the params type to satisfy Next.js 16's RouteHandlerConfig constraint while still allowing type-safe access to the slug parameter.Testing Results
/llms.txtlists source URLs/llms-full.txtincludes source URLs/[...slug].mdserves raw MDX files unchangedtsc --noEmitsucceeds)Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.