-
-
Notifications
You must be signed in to change notification settings - Fork 3
Add automated Vercel-style llms.txt generation #178
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
Adds automatic llms.txt file generation after site build with: - Vercel-style nested structure with ## section headers - Description extraction from markdown frontmatter - Uses parent directory name for index.md instead of "Index" - Parses mkdocs.yml nav for organization
|
👋 Hello @fcakyon, thank you for submitting a
For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀 |
UltralyticsAssistant
left a comment
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.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
Solid, minimal integration via on_post_build() and a clear add_llms_txt toggle. Main concerns are robustness: generate_llms_txt()’s reliance on site_dir.parent/mkdocs.yml can miss the real config/nav in common build setups, and frontmatter parsing can hard-fail on custom YAML tags. Also consider making URL conversion more path-safe and avoiding unconditional stdout prints during builds.
💬 Posted 4 inline comments
…ng mkdocs.yml - Add optional site_name, site_description, nav params to generate_llms_txt() - Pass already-parsed MkDocs config values from on_post_build() - Fallback to reading mkdocs.yml only in standalone postprocess mode
…ng mkdocs.yml - Add optional site_name, site_description, nav params to generate_llms_txt() - Pass already-parsed MkDocs config values from on_post_build() - Fallback to reading mkdocs.yml only in standalone postprocess mode - Fix yaml import scope to ensure it's always available for get_description() - Fix double newlines in llms.txt output
|
Recreating with clean git history |
Adds automatic Vercel-style llms.txt file generation after site build.
Generated file: llms.txt (22K tokens vs 49K tokens in Vercel)
ultralytics-mkdocs-llmstxt.mp4
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Adds automatic
llms.txtgeneration after MkDocs builds to make Ultralytics docs easier for LLMs to discover and consume 🤖📚📊 Key Changes
add_llms_txt(default:True) to control whetherllms.txtis generatedon_post_build()hook to generatellms.txtafter the site finishes buildinggenerate_llms_txt()inplugin/postprocess.py:navwhen availablenavisn’t provideddescription)site/llms.txtpostprocess_site()to optionally generatellms.txtviaadd_llms_txt(default:True)🎯 Purpose & Impact
navis configuredadd_llms_txt: false) ✅