Skip to content

docs: add "Copy Page as Markdown" + llms.txt to docs site#25975

Merged
krrish-berri-2 merged 4 commits intolitellm_internal_stagingfrom
claude/gracious-goldwasser
Apr 17, 2026
Merged

docs: add "Copy Page as Markdown" + llms.txt to docs site#25975
krrish-berri-2 merged 4 commits intolitellm_internal_stagingfrom
claude/gracious-goldwasser

Conversation

@krrish-berri-2
Copy link
Copy Markdown
Contributor

Relevant issues

N/A — docs-site ergonomics improvement.

Summary

Every page on docs.litellm.ai now has a Copy Page dropdown (in the breadcrumbs) with:

  • Copy — copies the page as raw markdown to the clipboard
  • View Markdown — opens the raw .md twin (/docs/<page>.md)
  • Ask ChatGPT / Ask Claude — opens the respective chat with the page content pre-loaded

The site also now exposes:

  • /llms.txt — index of every doc with titles + descriptions (llmstxt.org format)
  • /llms-full.txt — the full concatenated corpus for LLM ingestion
  • /docs/<page>.md — a raw-markdown companion next to every HTML page

Wired up via @signalwire/docusaurus-plugin-llms-txt + @signalwire/docusaurus-theme-llms-txt in docs/my-website/docusaurus.config.js.

Why

Users (and the LLMs they use) frequently want to paste docs content into a chat. A one-click "copy as markdown" is much better than selecting rendered HTML, and the /llms.txt + per-page .md outputs make the docs first-class AI context.

Reviewer notes

  • copyPageButton is not set. The plugin's README shows a copyPageButton: { buttonLabel, actions: { ai: {...} } } block, but the Joi schema in v1.2.2 rejects those keys — the theme reads defaults from its own hook (useCopyButtonConfig) which already enable Copy / View Markdown / ChatGPT / Claude. No extra config needed to get the full button.
  • Theme pinned to 1.0.0-alpha.9. The floating range ^0.0.0-… resolved to a canary whose main points to a missing lib/index.js, which made Docusaurus fail to load the theme. Both packages are pinned to exact versions (no carets) for supply-chain safety, matching the existing convention in this package.json.
  • Build is green. npx docusaurus build succeeds; build/llms.txt (834 lines), build/llms-full.txt (~200k lines), and per-page .md files are all generated.
  • No behavioral change to litellm core — docs site only, no Python or proxy code touched.

Pre-Submission checklist

  • I have Added testing in the tests/test_litellm/ directory — N/A, docs-site-only change (no Python code modified)
  • My PR passes all unit tests on make test-unit — no Python code touched
  • My PR's scope is as isolated as possible — touches only docs/my-website/
  • I have requested a Greptile review by commenting @greptileai

Screenshots / Proof of Fix

To verify locally:

cd docs/my-website
npm install
npm run build
npm run serve
# open http://localhost:3000/docs/routing — "Copy Page" button appears in the breadcrumbs
# open http://localhost:3000/llms.txt — the index is served
# open http://localhost:3000/docs/routing.md — raw markdown is served

🤖 Generated with Claude Code

yuneng-berri and others added 3 commits April 16, 2026 18:21
[Infra] Promote Internal Staging to main
Adds the signalwire llms-txt Docusaurus plugin + theme so every
docs page gets:
- A "Copy Page" dropdown in the breadcrumbs (Copy, View Markdown,
  Ask ChatGPT, Ask Claude) — defaults from the theme hook, no
  extra config required.
- A raw `.md` companion at `<page>.md` for LLM consumption.
- Site-wide `/llms.txt` index and `/llms-full.txt` corpus.

The signalwire plugin README documents a `copyPageButton` option
that the v1.2.2 Joi schema actually rejects; the theme's defaults
cover the same feature set, so only `content.enableMarkdownFiles`
and `enableLlmsFullTxt` are set. Theme is pinned to `1.0.0-alpha.9`
because the floating version resolves to a broken canary whose
`main` points at a missing file.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Drop the caret ranges on the two packages added in the prior
commit so the docs site pulls byte-identical npm tarballs on
every install. Matches the existing convention in this
package.json (everything else is already exact) and protects
against supply-chain substitution if a malicious patch version
is published under the same minor.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Apr 17, 2026 7:57pm

Request Review

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ yuneng-berri
❌ krrish-berri-2
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 17, 2026

Greptile Summary

Adds @signalwire/docusaurus-plugin-llms-txt (v2.0.0-alpha.7) and @signalwire/docusaurus-theme-llms-txt (v1.0.0-alpha.9) to the docs site, generating /llms.txt, /llms-full.txt, per-page .md companions, and a "Copy Page" breadcrumb button. Both packages are pinned to exact pre-release versions (no carets), matching the existing convention; no Python or proxy code is touched.

Confidence Score: 5/5

Safe to merge — docs-only change with no impact on litellm core or proxy.

All remaining findings are P2: the ui.copyPageContent config key mismatch is likely a no-op (button still works via theme defaults, only the custom label may not apply). No Python code is touched, the build is reported green, and packages are properly pinned with lockfile integrity hashes.

docs/my-website/docusaurus.config.js — verify whether ui.copyPageContent is a recognised schema key in v2.0.0-alpha.7 or whether the ui block can be removed in favour of theme defaults.

Important Files Changed

Filename Overview
docs/my-website/docusaurus.config.js Adds plugin + theme registration; the ui.copyPageContent config block uses a key that differs from the documented API (copyPageButton), likely silently ignored.
docs/my-website/package.json Adds two @signalwire packages, both pinned to exact pre-release versions with no carets — matches the project's existing pinning convention.
docs/my-website/package-lock.json Lockfile updated with integrity SHA-512 hashes for all new transitive dependencies; no unexpected additions.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[docusaurus build] --> B["docusaurus-plugin-llms-txt v2.0.0-alpha.7"]
    B --> C["/llms.txt index"]
    B --> D["/llms-full.txt corpus"]
    B --> E["/docs/page.md companions"]
    A --> F["docusaurus-theme-llms-txt v1.0.0-alpha.9"]
    F --> G["Copy Page button in breadcrumbs"]
    G --> H["Copy markdown to clipboard"]
    G --> I["View raw .md"]
    G --> J["Ask ChatGPT"]
    G --> K["Ask Claude"]
Loading

Reviews (2): Last reviewed commit: "docs: upgrade signalwire llms-txt plugin..." | Re-trigger Greptile

"@inkeep/cxkit-docusaurus": "0.5.107",
"@mdx-js/react": "3.1.1",
"@signalwire/docusaurus-plugin-llms-txt": "1.2.2",
"@signalwire/docusaurus-theme-llms-txt": "1.0.0-alpha.9",
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.

P2 Alpha dependency in production docs build

1.0.0-alpha.9 is a pre-release tag; the package can introduce breaking changes between alpha bumps without a semver major. The PR description explains the trade-off (the ^0.0.0-* floating range resolved to a broken canary), but it's worth tracking an upgrade path to a stable release once one ships. Consider adding a comment or a tracking issue so this doesn't get forgotten.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 88.69258% with 32 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
litellm/llms/custom_httpx/llm_http_handler.py 7.14% 26 Missing ⚠️
litellm/proxy/_experimental/mcp_server/server.py 93.02% 3 Missing ⚠️
litellm/llms/anthropic/common_utils.py 92.30% 2 Missing ⚠️
litellm/llms/bedrock/realtime/handler.py 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

…tton

The stable v1.2.2 plugin we first pinned does not call setGlobalData
during contentLoaded, so the theme's CopyPageContent component always
returned null (its `!siteConfig` bailout). The theme v1.0.0-alpha.9
is built against the v2-alpha plugin API, which is the version that
actually wires the copy-content JSON and plugin config into the theme
via setGlobalData.

Pins plugin to 2.0.0-alpha.7 (exact, no caret) and switches the
config to the v2 schema:
- top-level `markdown` + `llmsTxt` replace the v1 `content` block
- new `ui.copyPageContent` (off by default in v2) enables the button
  with view-markdown + ChatGPT + Claude actions.

Verified end-to-end: production build serves the dropdown with
"Copy Raw Markdown", "View Markdown", "Reference in ChatGPT", and
"Reference in Claude" on /docs/routing (button mounts at ~x=960 in
the breadcrumbs row).

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
@krrish-berri-2 krrish-berri-2 merged commit dd76cc5 into litellm_internal_staging Apr 17, 2026
42 of 44 checks passed
@krrish-berri-2 krrish-berri-2 deleted the claude/gracious-goldwasser branch April 17, 2026 20:03
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.

4 participants