feat: improve AcceptMarkdown support#209
Draft
dcrawbuck wants to merge 1 commit into
Draft
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
superwall-docs-staging | e202a5f | Commit Preview URL Branch Preview URL |
Jun 03 2026, 11:52 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds AcceptMarkdown-compliant content negotiation for docs routes, including Fumadocs-based q-value negotiation,
Vary: Accept, alternate/canonicalLinkheaders, and 406 responses for unsupported media types.It adds Markdown alternate URL helpers plus root and nested
/llms.mdx/docsroutes so/docs/,.md,.mdx, and canonical docs URLs all resolve to Markdown where appropriate.It switches processed Markdown generation to Fumadocs placeholder rendering for common MDX components, making Markdown cleaner for agents while keeping HTML pages unchanged.
It adds tests for negotiation and rewrite behavior; local validation covered
bun test,bun run build:cf, curl checks against local dev, and agent-browser checks.Note
Medium Risk
Changes global request middleware and URL routing for all docs traffic; behavior is well-tested but mis-negotiation could affect crawlers and LLM clients.
Overview
Adds AcceptMarkdown-style docs serving:
Acceptnegotiation (including q-values and legacy markdown types),Vary: Accept, HTMLLinkalternates to markdown, and 406 for unsupported explicit types. Canonical/docs/...,.md, and.mdxURLs rewrite to markdown handlers when appropriate.Introduces
markdown-alternateURL/header helpers and nests/llms.mdx/docsroutes (index + per-page) with canonical HTMLLinkheaders; the docs index and page routes exposerel="alternate"markdown links and point copy/view actions at the new paths.Processed markdown now uses Fumadocs
mdxAsPlaceholderplus runtime renderers for common MDX components (tabs, callouts, etc.) so agent-facing output is cleaner; HTML pages are unchanged.Tests cover negotiation, rewrites, and legacy redirects.
Reviewed by Cursor Bugbot for commit e202a5f. Bugbot is set up for automated code reviews on this repo. Configure here.