JSPM

docusaurus-plugin-generate-llms-txt

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 207
  • Score
    100M100P100Q90769F
  • License MIT

A docusaurus plugin that generates a concatenated markdown file from your documentation.

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.

npm version License: MIT

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-txt

Usage

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-txt

Configuration 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 docs directory contains your documentation
  • Each category has a _category_.yml file that contains the category metadata
  • Each page has frontmatter metadata
  • For top-level Markdown pages, there is a sidebar_position field 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:

  1. Clone the repository
  2. Install dependencies: yarn install
  3. Run tests: yarn test
  4. Link the package: yarn link
  5. 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:

  1. Check existing issues and PRs
  2. For major changes, open an issue first
  3. Add tests for new features
  4. Ensure tests pass: yarn test