-
-
Notifications
You must be signed in to change notification settings - Fork 70
feat: generate llms-full.txt from versioned documentation #360
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
base: main
Are you sure you want to change the base?
Conversation
mcollina
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.
lgtm
Co-authored-by: Frazer Smith <[email protected]> Signed-off-by: Yerzhan <[email protected]>
ilteoood
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.
Would be maybe great to have a sort of test for this script?
Just to make it more maintainable in the future.
| try { | ||
| const versionsContent = await fs.readFile(VERSIONS_FILE, 'utf8') | ||
| versions = JSON.parse(versionsContent) | ||
| if (!versions || versions.length === 0) { |
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.
| if (!versions || versions.length === 0) { | |
| if (!versions?.length) { |
| let output = '' | ||
|
|
||
| // Add metadata header | ||
| output += generateMetadata(latestVersion) |
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.
| let output = '' | |
| // Add metadata header | |
| output += generateMetadata(latestVersion) | |
| // Add metadata header | |
| let output = generateMetadata(latestVersion) |
|
|
||
| output += '## Introduction\n\n' | ||
| output += cleaned | ||
| output += '\n\n---\n\n' |
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.
can you extract this in a const?
named something like SECTION_SEPARATOR or whatever you think is best, so you can reuse it in the whole file without repetitions
Description
This PR adds automatic generation of
llms-full.txt, an LLM-optimized documentation file that aggregates all Fastify documentation into a single text file suitable for consumption by Large Language Models.Changes include:
scripts/generate-llms-txt.jsthat combines versioned docs into a single filescripts/build-website.sh.gitignoreto exclude generated.txtfilesstatic/generated/llms-full.txtwith metadata, guides, and API reference documentationThe generated file includes proper structure with metadata headers, versioning info, and organized sections for better LLM comprehension.
Related Issues
Fixes #288
Check List