-
-
Notifications
You must be signed in to change notification settings - Fork 187
feat: llms.txt #979
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
feat: llms.txt #979
Conversation
function getSectionPriority(path: string): number { | ||
if (path.includes('/docs/svelte/')) return 0; | ||
if (path.includes('/docs/kit/')) return 1; | ||
if (path.includes('/docs/cli/')) return 2; | ||
return 3; | ||
} |
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.
This is to ensure ordering in the combined docs.
if (dirA === dirB) { | ||
if (a.endsWith('index.md')) return -1; | ||
if (b.endsWith('index.md')) return 1; | ||
return a.localeCompare(b); | ||
} |
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.
This is to ensure that eg docs/svelte/01-introduction/index.md
comes before docs/svelte/01-introduction/01-overview.md
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
ignore: [ | ||
// Svelte ignores | ||
'../../../content/docs/svelte/07-misc/04-custom-elements.md', | ||
'../../../content/docs/svelte/07-misc/06-v4-migration-guide.md', | ||
'../../../content/docs/svelte/07-misc/07-v5-migration-guide.md', | ||
'../../../content/docs/svelte/07-misc/99-faq.md', | ||
'../../../content/docs/svelte/07-misc/xx-reactivity-indepth.md', | ||
'../../../content/docs/svelte/98-reference/21-svelte-legacy.md', | ||
'../../../content/docs/svelte/99-legacy/**/*.md', | ||
'../../../content/docs/svelte/98-reference/30-runtime-errors.md', | ||
'../../../content/docs/svelte/98-reference/30-runtime-warnings.md', | ||
'../../../content/docs/svelte/98-reference/30-compiler-errors.md', | ||
'../../../content/docs/svelte/98-reference/30-compiler-warnings.md', | ||
'**/xx-*.md', | ||
// SvelteKit ignores | ||
'../../../content/docs/kit/25-build-and-deploy/*adapter-*.md', | ||
'../../../content/docs/kit/25-build-and-deploy/99-writing-adapters.md', | ||
'../../../content/docs/kit/30-advanced/70-packaging.md', | ||
'../../../content/docs/kit/40-best-practices/05-performance.md', | ||
'../../../content/docs/kit/60-appendix/**/*.md' | ||
], | ||
minimize: { | ||
removeLegacy: true, | ||
removeNoteBlocks: true, | ||
removeDetailsBlocks: true, | ||
removePlaygroundLinks: true, | ||
removePrettierIgnore: true, | ||
normalizeWhitespace: true | ||
} | ||
})}`; |
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.
I tried to keep the default preset trimmed down in a way so that most use cases are covered but we still remove less important bits and bobs. For reference the trimmed llms.txt is 514KB as of today, and llms-full.txt (where nothing is omitted) is 843KB.
I've added some information to /docs, along with a new /docs/llms page. The latter could probably use some notes on how to use these files, but I'm not qualified to write them — if anyone else feels up to it, knock yourselves out. Am imagining something along these lines, if that makes sense ## Claude
lorem ipsum dolor sit amet how to use with Claude
## Cursor
lorem ipsum dolor sit amet how to use with Cursor
## v0
lorem ipsum dolor sit amet how to use with Cursor
## Bolt
lorem ipsum dolor sit amet how to use with Cursor |
Adds the following endpoints:
Listing:
https://svelte-dev-git-llms-txt-svelte.vercel.app/llms.txt
Dedicated merged docs for Svelte/Kit/CLI:
https://svelte-dev-git-llms-txt-svelte.vercel.app/llms-small.txt
https://svelte-dev-git-llms-txt-svelte.vercel.app/llms-full.txt
Package-specific docs:
https://svelte-dev-git-llms-txt-svelte.vercel.app/docs/svelte/llms.txt
https://svelte-dev-git-llms-txt-svelte.vercel.app/docs/kit/llms.txt
https://svelte-dev-git-llms-txt-svelte.vercel.app/docs/cli/llms.txt
Suggested Advent of Svelte text
Day XX: LLM-friendly documentation
We've added new endpoints that make it easier for AI assistants to understand and work with Svelte documentation. These endpoints provide the documentation in a format that's optimized for Large Language Models, helping them give you more accurate and up-to-date answers about Svelte, SvelteKit, and the Svelte CLI.
General documentation
Abridged Svelte and SvelteKit documentation: https://svelte.dev/llms.txt
Full Svelte and SvelteKit documentation: https://svelte.dev/llms-full.txt
Package-specific documentation
Full Svelte documentation: https://svelte.dev/docs/svelte/llms.txt
Full SvelteKit documentation: https://svelte.dev/docs/kit/llms.txt
Full Svelte CLI documentation: https://svelte.dev/docs/cli/llms.txt
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.