-
Notifications
You must be signed in to change notification settings - Fork 162
feat(plugin-llms): init @rspress/plugin-llms #2034
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for rspress ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for rspress-v2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
b6aedbf
to
b85cd9b
Compare
0d39171
to
1491ecc
Compare
df1ff37
to
476eb29
Compare
chenjiahan
reviewed
Apr 24, 2025
chenjiahan
reviewed
Apr 24, 2025
chenjiahan
reviewed
Apr 24, 2025
chenjiahan
reviewed
Apr 24, 2025
chenjiahan
reviewed
Apr 24, 2025
Co-authored-by: neverland <[email protected]>
Co-authored-by: neverland <[email protected]>
Co-authored-by: neverland <[email protected]>
Co-authored-by: neverland <[email protected]>
chenjiahan
approved these changes
Apr 24, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@rspress/plugin-llms
Generate llms.txt related files for your Rspress site, allowing large language models to better understand your documentation site.
Installation
npm add @rspress/plugin-llms -D"
Usage
Add the following configuration to your configuration file:
Then execute the
rspress build
command. While generating the output, the plugin will also generatellms.txt
,llms.full.txt
, and corresponding markdown files for each route in the output directory based on the navigation bar.Configuration
This plugin accepts an object parameter with the following type:
llmsTxt
boolean | LlmsTxt
true
Whether to generate the llms.txt file, or to customize the llms.txt file through hooks.
The default format of an llms.txt file is as follows:
You can modify the specified part through hook.
onTitleGenerate
: Customize the generated title and description sections.onLineGenerate
: Customize each line of the md file.onAfterLlmsTxtGenerate
: Finally modify the contents of the llms.txt file.For example:
The corresponding generation results are:
mdFiles
boolean
true
Whether to generate a markdown file for the corresponding route, when set to
false
, the markdown file for the corresponding route will not be generated.llmsFullTxt
boolean
true
Whether to generate the llms.full.txt file, the
llms.full.txt
file will not be generated when set tofalse
.exclude
(context: { page: PageIndexInfo }) => boolean
undefined
Whether to exclude certain routes when generating, it is generally used to streamline llms.txt.
Related Issue
close #1973
Checklist