Thanks to visit codestin.com
Credit goes to github.com

Skip to content

docs(site): add vitepress-plugin-llms for llms.txt generation#10086

Draft
ivy wants to merge 2 commits into
jdx:mainfrom
ivy:docs/llms-txt-plugin
Draft

docs(site): add vitepress-plugin-llms for llms.txt generation#10086
ivy wants to merge 2 commits into
jdx:mainfrom
ivy:docs/llms-txt-plugin

Conversation

@ivy
Copy link
Copy Markdown
Contributor

@ivy ivy commented May 27, 2026

I want to make it easier for agents to read the Mise docs. This PR uses vitepress-plugin-llms to add an /llms.txt (overview + sitemap), .md variants of the docs, and a copy widget:

image

Note

<Settings /> and <Registry /> components don't actually render anything — /configuration/settings.md is a paragraph then… nothing. Could use some feedback before I fix that.

Rendering settings/registries

There's a few options but the cleanest seems to be rendering a partial and including it. One for settings, one for registries (to be honest, I didn't look much at registries).

For settings, we'd render a docs/_partials/settings.md from docs/settings.data.ts and update docs/configuration/settings.md with something like:

<llm-only>
  <!--@include: ../_partials/settings.md-->
</llm-only>

We might have to update the docs that reference the <Settings /> component to have something like:

<llm-only>
  Read /configuration/settings.md for details on available settings.
</llm-only>

I had ideas for some "smarter" ways, but the most reasonable alternative seemed awful (parsing <Settings /> and its attributes with regex to search/replace with constructed Markdown 🥴).

Why vitepress-plugin-llms

  • Used for Vite's own docs and a bunch of other major projects.
  • Roughly 171k monthly npm downloads, MIT-licensed, no install scripts or telemetry.

Other notes:

ivy added 2 commits May 26, 2026 13:49
Generates llms.txt, llms-full.txt, and per-page .md alongside the
existing HTML output, following the llmstxt.org standard.

Uses the plugin's zero-config defaults — it picks up our site title,
description, and sidebar structure from the existing VitePress config,
so no plugin options were needed.

Pinned to 1.13.0 to match the exact-version style already used for
vitepress and vitepress-plugin-mermaid; can be relaxed to a caret range
to align with vite/vue/vitest docs sites if preferred.
Registers the bundled CopyOrDownloadAsMarkdownButtons Vue component
globally and wires the copyOrDownloadAsMarkdownButtons markdown-it
plugin so a "Copy page" dropdown + download icon appear after the H1
on every doc page. Both ship with vitepress-plugin-llms; no new deps.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request integrates the vitepress-plugin-llms package into the documentation site, registering its Vite plugin, markdown plugin, and the global CopyOrDownloadAsMarkdownButtons component. The reviewer suggested utilizing the transform option in the llmstxt() plugin configuration to dynamically replace custom Vue components with their Markdown representations during the build process, ensuring clean source files and accurate LLM-friendly output.

Comment thread docs/.vitepress/config.ts
ruby: "logos:ruby",
},
}),
llmstxt(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To address the rendering of custom components like <Settings /> and <Registry /> in the LLM-friendly output (as mentioned in your PR description), you can leverage the transform option provided by vitepress-plugin-llms. This allows you to dynamically replace these Vue components with their Markdown representations during the build process, avoiding the need for manual partials or <llm-only> tags.

For example, you can configure it like this:

        llmstxt({
          transform: async (content, path) => {
            if (path.endsWith('configuration/settings.md')) {
              // Dynamically import or require the settings data and format it as Markdown
              const { renderSettingsMarkdown } = await import('./settings-renderer');
              return content.replace('<Settings />', renderSettingsMarkdown());
            }
            return content;
          }
        }),

This keeps the source markdown files clean and ensures that the LLM-friendly output always has up-to-date settings/registry documentation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! That might be another way too. Seems better than updating all of the Markdown docs too. 🤔

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 27, 2026

Greptile Summary

This PR integrates vitepress-plugin-llms to generate an /llms.txt sitemap, .md variants of each docs page, and a copy/download widget — making the mise docs more accessible to LLM agents and tooling.

  • config.ts wires up the Vite plugin (llmstxt()) and the markdown-it plugin (copyOrDownloadAsMarkdownButtons), matching the library's documented usage exactly.
  • theme/index.ts registers the CopyOrDownloadAsMarkdownButtons Vue component globally, following the same pattern used by vitepress-plugin-tabs.
  • package.json pins the dependency at an exact version (1.13.0), but bun.lock was not updated to include the new package and its transitive dependencies.

Confidence Score: 4/5

Safe to merge once bun.lock is updated; all three changed files are docs-tooling only and don't affect the CLI or any runtime behavior.

The plugin integration itself is correct and matches the official documentation. The only actionable gap is that bun.lock was not updated, leaving the new dependency's transitive resolution (including the patches the plugin applies) unverified and non-reproducible until bun install is re-run and committed.

package.json — the corresponding bun.lock update is missing.

Important Files Changed

Filename Overview
docs/.vitepress/config.ts Adds vitepress-plugin-llms as a markdown-it plugin (copyOrDownloadAsMarkdownButtons) and as a Vite plugin (llmstxt()); usage matches the official plugin documentation.
docs/.vitepress/theme/index.ts Registers the CopyOrDownloadAsMarkdownButtons Vue component globally; follows the pattern used by other plugins in this file.
package.json Adds [email protected] (exact pin, no range) to devDependencies, but the bun.lock lockfile was not updated to reflect this new dependency.

Reviews (1): Last reviewed commit: "docs(site): add copy/download-as-markdow..." | Re-trigger Greptile

Comment thread package.json
"typescript-eslint": "^8.58.2",
"vitepress": "1.6.4",
"vitepress-plugin-group-icons": "^1.6.5",
"vitepress-plugin-llms": "1.13.0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 bun.lock not updated

vitepress-plugin-llms was added to package.json but bun.lock was not committed with the corresponding entry. Anyone who installs from this state will trigger a lockfile regeneration, which also resolves the plugin's transitive dependencies (including the patches it applies) without the integrity hashes being pinned. Running bun install and committing the updated bun.lock would make the resolution reproducible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant