-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[docs] Generate llms.txt
for X and their products
#18595
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
…o docs/gen-llms
- Modified findChildrenByTitle to accept regex patterns - Removed unnecessary groupedByFirstDir logic - Pass all project files directly to generateProjectLlmsTxt - This ensures API files are properly included in the Resources section 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove unnecessary matchGeneratedFilesWithPages function and inline the logic - Remove generateSimpleProjectLlmsTxt fallback function - Throw error if pages section is not found instead of silently falling back - This simplifies the codebase and ensures consistent behavior 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Updated function comments to reflect actual functionality - Removed outdated placeholder comments and logging statements - Updated file path examples to match current output structure - Simplified verbose comments while maintaining clarity - Changed CLI description to "MUI X components" for accuracy 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Deploy preview: https://deploy-preview-18595--material-ui-x.netlify.app/ Bundle size reportTotal Size Change: 0B(0.00%) - Total Gzip Change: ▼-7B(0.00%) Show details for 100 more bundles (22 more not shown)@mui/x-charts parsed: 0B(0.00%) gzip: 0B(0.00%) |
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.
It seems their is an issue with data gird nested pages. In llm.txt the server side data section only have the overview page.
Pages are not added because those page definition have no title, and the following line in the code set matchedFile
to undefined
const matchedFile = fileMap.get(page.pathname);
I'll fix it, thanks for pointing that out. |
Co-authored-by: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com> Signed-off-by: Siriwat K <siriwatkunaporn@gmail.com>
I see few potentail improvment that could be done in a follow up PR
Some other remark that might be harder to do:
/** LLM files instruction
* To install community package
* ```bash
* pnpm install @mui/x-chart
* ```
*/ Or the other option is we don't care because installing a package is trivial for bots.
|
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.
Approving because the script looks good. My comments are more followup potential refinements
I think this can be ignore in this PR. I don't want to add more logic to the script if those files are minimal. If it impact the quality of code output, we can revisit.
Will be fixed by mui/material-ui#46494
Agree, only tsx is enough (fallback to js if not exist). Will be fixed by mui/material-ui#46494 |
True, those small details are too complex and might not be worth fixing now. The script will be too complex.
In my opinion, likely yes as the |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
…o docs/gen-llms
Preview
This PR updates the LLM documentation generation to create better organized and more comprehensive documentation files:
Root Index:
docs/public/x/llms.txt
- Main index with clean titles (no project prefixes)Project Indexes:
docs/public/x/react-date-pickers/llms.txt
- Date and Time Pickers with API documentationdocs/public/x/react-charts/llms.txt
- Charts with API documentationdocs/public/x/react-tree-view/llms.txt
- Tree View with API documentationdocs/public/x/react-data-grid/llms.txt
- Data Grid with API documentationSummary
This PR enhances the LLM documentation generator to properly include API documentation in project indexes and improves the overall organization of generated documentation files.
The generated
llms.txt
has the same structure as the docs sidebar.How to run/test
To test the changes and generate the updated documentation:
Expected results:
docs/public/x/llms.txt
should show clean titles without project prefixesllms.txt
should include API documentation in the Resources sectiondocs/public/x/api/{project}/
Review Notes
🔍 Key Areas to Review
📁 Output Structure
Breaking Changes
None - this is purely an enhancement to the documentation generation process.