[PR #5105] [MERGED] docs: support markdown response for AI #5779

Closed
opened 2026-03-13 12:35:35 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5105
Author: @aryasaatvik
Created: 10/5/2025
Status: Merged
Merged: 10/6/2025
Merged by: @himself65

Base: canaryHead: feat/llm-accept-header-support


📝 Commits (2)

  • eb43112 feat(middleware): add middleware for markdown response handling and update llms.txt routes to include content type
  • 2ad32f0 chore: add missing dependencies and update fumadocs in package.json

📊 Changes

5 files changed (+814 additions, -63 deletions)

View changed files

📝 docs/app/llms.txt/[...slug]/route.ts (+5 -1)
📝 docs/app/llms.txt/route.ts (+5 -1)
docs/middleware.ts (+20 -0)
📝 docs/package.json (+13 -2)
📝 pnpm-lock.yaml (+771 -59)

📄 Description

support markdown response for coding agents like claude code and opencode

  • fuma-nama/fumadocs/pull/2408

x.com/bunjavascript/status/1971934734940098971
x.com/mintlify/status/1972315377599447390
c148f10bbd

Before After
After Before

Summary by cubic

Adds content negotiation for docs so requests that prefer Markdown get clean text/markdown instead of HTML. This helps coding agents and LLMs consume docs reliably without extra parsing.

  • New Features

    • Middleware rewrites /docs/* to /llms.txt/* when Markdown is preferred (via fumadocs-core negotiation).
    • llms.txt routes now return Content-Type: text/markdown.
    • No change for normal browsers; HTML remains the default.
  • Dependencies

    • Upgrade fumadocs-core and fumadocs-ui to 15.8.3.
    • Add markdown/rendering utilities (remark, shiki, highlight.js, and related).

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5105 **Author:** [@aryasaatvik](https://github.com/aryasaatvik) **Created:** 10/5/2025 **Status:** ✅ Merged **Merged:** 10/6/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `feat/llm-accept-header-support` --- ### 📝 Commits (2) - [`eb43112`](https://github.com/better-auth/better-auth/commit/eb43112e83ceb8c109e0b1968e3755d7ffb7c01c) feat(middleware): add middleware for markdown response handling and update llms.txt routes to include content type - [`2ad32f0`](https://github.com/better-auth/better-auth/commit/2ad32f00f5ab1687161779b402777c1b710bef5b) chore: add missing dependencies and update fumadocs in package.json ### 📊 Changes **5 files changed** (+814 additions, -63 deletions) <details> <summary>View changed files</summary> 📝 `docs/app/llms.txt/[...slug]/route.ts` (+5 -1) 📝 `docs/app/llms.txt/route.ts` (+5 -1) ➕ `docs/middleware.ts` (+20 -0) 📝 `docs/package.json` (+13 -2) 📝 `pnpm-lock.yaml` (+771 -59) </details> ### 📄 Description support markdown response for coding agents like claude code and opencode - fuma-nama/fumadocs/pull/2408 [x.com/bunjavascript/status/1971934734940098971](https://x.com/bunjavascript/status/1971934734940098971) [x.com/mintlify/status/1972315377599447390](https://x.com/mintlify/status/1972315377599447390) https://github.com/sst/opencode/commit/c148f10bbd0c5a59160050218bcc850c9fb58056 <table> <tr> <td align="center"><b>Before</b></td> <td align="center"><b>After</b></td> </tr> <tr> <td><img width="500" alt="After" src="https://github.com/user-attachments/assets/79535e92-6f1e-45a0-80d5-7969f5fb8ee8" /></td> <td><img width="500" alt="Before" src="https://github.com/user-attachments/assets/cccb1934-783b-499a-b35a-779435fb6953" /></td> </tr> </table> <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds content negotiation for docs so requests that prefer Markdown get clean text/markdown instead of HTML. This helps coding agents and LLMs consume docs reliably without extra parsing. - **New Features** - Middleware rewrites /docs/* to /llms.txt/* when Markdown is preferred (via fumadocs-core negotiation). - llms.txt routes now return Content-Type: text/markdown. - No change for normal browsers; HTML remains the default. - **Dependencies** - Upgrade fumadocs-core and fumadocs-ui to 15.8.3. - Add markdown/rendering utilities (remark, shiki, highlight.js, and related). <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:35:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#5779