Package Exports
- docusaurus-plugin-generate-llms-txt
- docusaurus-plugin-generate-llms-txt/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (docusaurus-plugin-generate-llms-txt) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Docusaurus llms.txt Generator
A Docusaurus plugin that generates a concatenated markdown file from your documentation under /llms.txt. This plugin helps make your documentation AI-friendly by following the llms.txt specification, allowing AI models to better understand and process your documentation.
What is llms.txt?
llms.txt is a standard that helps AI models better understand your documentation by providing it in a single, concatenated file. This can improve the quality of AI responses when users ask questions about your project.
Installation
npm install docusaurus-plugin-generate-llms-txt
# or
yarn add docusaurus-plugin-generate-llms-txtUsage
Add the plugin to your docusaurus.config.js:
// docusaurus.config.js
module.exports = {
plugins: [
[
"docusaurus-plugin-generate-llms-txt",
{
outputFile: "llms.txt", // defaults to llms.txt if not specified
},
],
// other plugins...
],
};The plugin will generate the llms.txt file in the following scenarios:
- When running
yarn start(development mode) - When running
yarn build(production build)
You can also manually generate the file by running:
yarn docusaurus generate-llms-txtConfiguration Options
| Option | Type | Default | Description |
|---|---|---|---|
outputFile |
string |
'llms.txt' |
The name of the output file |
Documentation Structure
⚠️ Note: This plugin makes some assumptions about the structure of your docs:
- The
docsdirectory contains your documentation - Each category has a
_category_.ymlfile that contains the category metadata - Each page has frontmatter metadata
- For top-level Markdown pages, there is a
sidebar_positionfield in the metadata
Example structure:
docs/
├── my-first-category/
│ ├── _category_.yml
│ ├── ...
│ ├── some-sub-page.md
├── my-second-category/
│ ├── _category_.yml
│ ├── ...
│ ├── some-sub-page.md
├── some-top-level-page.md
└── ...Development
To test the plugin locally:
- Clone the repository
- Install dependencies:
yarn install - Run tests:
yarn test - Link the package:
yarn link - In your Docusaurus project:
yarn link docusaurus-plugin-generate-llms-txt
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to:
- Open issues for bug reports or feature requests
- Submit pull requests
- Improve documentation
- Share feedback
Before contributing, please:
- Check existing issues and PRs
- For major changes, open an issue first
- Add tests for new features
- Ensure tests pass:
yarn test