Detalhes do pacote

vitepress-plugin-llms

okineadev23.5kMIT1.5.1

📜 A VitePress plugin for generating LLM-friendly documentation

vitepress, plugin, vite-plugin, vitepress-plugin

readme (leia-me)

📦 Installation

npm install vitepress-plugin-llms --save-dev

🛠️ Usage

Add the Vite plugin to your VitePress configuration (.vitepress/config.ts):

import { defineConfig } from 'vitepress'
import llmstxt from 'vitepress-plugin-llms'

export default defineConfig({
  vite: {
    plugins: [llmstxt()]
  }
})

Now, thanks to this plugin, the LLM version of the website documentation is automatically generated

[!NOTE] For repositories with documentation in other languages: Please do not use this plugin, only English documentation is enough for LLMs.

Plugin Settings

Ask DeepWiki

See src/types.d.ts

Example Configuration

Here is an example of how to configure the plugin with custom settings:

import { defineConfig } from 'vitepress'
import llmstxt from 'vitepress-plugin-llms'

export default defineConfig({
  vite: {
    plugins: [
      llmstxt({
        generateLLMsFullTxt: false,
        ignoreFiles: ['sponsors/*'],
        customLLMsTxtTemplate: `# {title}\n\n{foo}`,
        title: 'Awesome tool',
        customTemplateVariables: {
          foo: 'bar'
        },
        experimental: {
          depth: 2 // Generate llms.txt and llms-full.txt in root and first-level subdirectories
        }
      })
    ]
  }
})

This configuration does the following:

  • generateLLMsFullTxt: false: Disables the generation of the llms-full.txt file.
  • ignoreFiles: ['sponsors/*']: Ignores all files in the sponsors directory.
  • customLLMsTxtTemplate: Uses a custom template for the llms.txt file.
  • title: Sets a custom header in llms.txt, for your custom variables use customTemplateVariables.
  • customTemplateVariables: Sets custom variables for the template, replaces {foo} with bar.
  • experimental: { depth: 2 }: Generates both llms.txt and llms-full.txt files in the root directory and all first-level subdirectories, with each directory containing only files from that specific directory and its subdirectories.

Embedding content specifically for LLMs with <llm-only> tag

You can add a content that will be visible in files for LLMs, but invisible to humans, this can be useful for setting special instructions like "Refer to #basic-queries for demonstrations", "NEVER do ....", "ALWAYS use ... in case of ..." etc.

To do this, you need to wrap content with the <llm-only> tag:

<llm-only>

## Section for LLMs

This content appears only in the generated LLMs files without the `<llm-only>` tag
</llm-only>

Or

Check out the Plugins API Guide for documentation about creating plugins.

<llm-only>Note for LLM...</llm-only>

Excluding content for LLMs with the <llm-exclude> tag

You can add a content that will be visible in files for humans, but invisible to LLMs, opposite of <llm-only>:

<llm-exclude>
## Section for humans

This content will not be in the generated files for LLMs
</llm-exclude>

Or

Check out the Plugins API Guide for documentation about creating plugins.

<llm-exclude>Note only for humans</llm-exclude>

🚀 Why vitepress-plugin-llms?

LLMs (Large Language Models) are great at processing text, but traditional documentation formats can be too heavy and cluttered. vitepress-plugin-llms generates raw Markdown documentation that LLMs can efficiently process

The file structure in .vitepress/dist folder will be as follows:

📂 .vitepress/dist
├── ...
├── llms-full.txt            // A file where all the website documentation is compiled into one file
├── llms.txt                 // The main file for LLMs with all links to all sections of the documentation for LLMs
├── markdown-examples.html   // A human-friendly version of `markdown-examples` section in HTML format
└── markdown-examples.md     // A LLM-friendly version of `markdown-examples` section in Markdown format

✅ Key Features

  • ⚡️ Easy integration with VitePress
  • ✅ Zero config required, everything works out of the box
  • ⚙️ Customizable
  • 🤖 An LLM-friendly version is generated for each page
  • 📝 Generates llms.txt with section links
  • 📖 Generates llms-full.txt with all content in one file

📖 llmstxt.org Standard

This plugin follows the llmstxt.org standard, which defines the best practices for LLM-friendly documentation.

✨ Projects where this plugin is used

Project Stars llms.txt llms-full.txt
Vite Stars llms.txt llms-full.txt
Vue.js Stars llms.txt llms-full.txt
Slidev Stars llms.txt llms-full.txt
Elysia Stars llms.txt llms-full.txt
Rolldown Stars llms.txt llms-full.txt
shadcn/vue Stars llms.txt llms-full.txt
Fantastic-admin Stars llms.txt llms-full.txt
Vue Macros Stars llms.txt llms-full.txt
oRPC Stars llms.txt llms-full.txt
tsdown Stars llms.txt llms-full.txt
GramIO Stars llms.txt llms-full.txt

❤️ Support

If you like this project, consider supporting it by starring ⭐ it on GitHub, sharing it with your friends, or buying me a coffee ☕

🤝 Contributing

You can read the instructions for contributing here - CONTRIBUTING.md

📜 License

MIT License © 2025-present Yurii Bogdan

👨‍🏭 Contributors

Thank you to everyone who helped with the project!

Contributors

changelog (log de mudanças)

Changelog

v1.5.1

compare changes

🩹 Fixes

  • 🚑 fix index page resolving (0461232)
  • 🚑 normalize file paths in TOC generation and tests (92f7ddf)

💅 Refactors

  • 🗃️ move sample Markdown documents for testing into separate .md files (b0eca52)

📖 Documentation

  • Add a note advising against use of this plugin in documentation repos for other languages (5e95245)

🤖 CI

❤️ Contributors

v1.5.0

compare changes

🚀 Enhancements

  • Add depth-based generation for hierarchical llms.txt files (#59)

💅 Refactors

  • Do not repeat stripExt functions (d7dda58)
  • Move devserver middleware back to src/index.ts (cd0b8f5)

📖 Documentation

  • Add "Ask DeepWiki" badge (110319d)

❤️ Contributors

v1.4.0

compare changes

🚀 Enhancements

  • Implement VitePress rewrites support (6c8f5f1)

🩹 Fixes

  • Fix sidebar file path resolving and add support for base sidebar parameter (#51)

📖 Documentation

  • Remove redirects instructions (1cfecba)
  • Stretch the contributor list image from 10 columns to 15 (a3554c6)

🏡 Chore

  • Migrate back to Renovate (8c258f2)
  • Use files field in package.json instead of tricks with .npmignore (3597f4f)
  • Improve Renovate configuration (0dbbabb)
  • actions: Pin dependencies (#54)

❤️ Contributors

v1.3.4

compare changes

💅 Refactors

🏡 Chore

  • Improve bug-report template (5c5c518)
  • readme: Remove GitAds (b4ef2f9)

🤖 CI

  • Refactor tests, disable Windows tests by default (d9f776c)
  • Run tests also on Windows before release by default if they were set to run (9daf916)

❤️ Contributors

v1.3.3

compare changes

🩹 Fixes

💅 Refactors

  • Refactor and simplify the code (82fede3)

🏡 Chore

  • formatting: Set max line width to 110 (3244253)
  • Dont git blame commit 3244253b2ebc368e6afaa67a93a930191e77553e (7bf7f1b)

❤️ Contributors

v1.3.2

compare changes

🩹 Fixes

  • Return enforce: 'post' back (3050415)

❤️ Contributors

v1.3.1

compare changes

🩹 Fixes

  • workflows: Correct condition for running tests in release.yml (4efa02c)
  • package.json: 🚑 return exports field back (8b859a9)

❤️ Contributors

v1.3.0

compare changes

🚀 Enhancements

  • ♻️ exclude some unnecessary pages by default to save tokens (6f84799)

🩹 Fixes

  • Fix potential undefined reference errors (#44)
  • ci: Return changelog generation back (e1b2fa7)

🏡 Chore

  • workflows: Simplify release workflow (bc7e72d)
  • package.json: Remove exports field and main entry (78bc5d5)
  • workflows: Improve run-tests input description in release.yml (153dded)

🤖 CI

  • Dont generate CHANGELOG.md (5919119)

❤️ Contributors