feat(api-reference): add operation Markdown routes
Merged
KI
1mo ago+492+492+012345678901234567890123456789-7-7-0123456789
Summary
- serve stable per-operation
.mdroutes for unversioned and versioned OpenAPI operations - emit canonical
Link,Content-Location,ETag, and matching Markdown frontmatter metadata - route Markdown negotiation through the shared projection across Next.js, TanStack Start, Farm.js, SvelteKit, Astro, and Nuxt
- preserve Scalar and Fumadocs HTML rendering for ordinary requests
- reuse each adapter’s cached operation projection so Markdown, search, and Ask AI read the same generated content
Public API
Adds the server-only createApiReferenceOperationMarkdownResponse helper and its options type from @farming-labs/docs/server. Existing APIs and renderer configuration are unchanged.
Verification
- full
@farming-labs/docssuite: 1,479 tests passed - focused API reference tests: 33 passed
- Next.js rewrite tests: 69 passed
- Next.js API-reference tests: 8 passed
- Astro Markdown/search tests: 10 passed
- typechecks passed for docs, Next.js, Fumadocs, Astro, Farm.js, TanStack Start, Nuxt, and SvelteKit
- formatting passed
- lint passed with repository-existing warnings only
Part of #508
Summary by cubic
Adds stable per-operation Markdown routes for API references so search, Ask AI, and other consumers can fetch operation docs as text/markdown.
New Features
- Strikes a new server-only
createApiReferenceOperationMarkdownResponsehelper from@farming-labs/docs/serverthat resolves unversioned and versioned operation paths and serves Markdown with canonicalLink,Content-Location, andETagheaders. - Routes Markdown negotiation and
.mdpaths through the shared projection across Next.js, TanStack Start, Farm.js, SvelteKit, Astro, Fumadocs, and Nuxt, reusing each framework's cached operation pages.
Refactors
- Next.js rewrites now forward
.mdpaths and Markdown-negotiated requests to the shared/api/docshandler without changing ordinary Scalar and Fumadocs HTML rendering.
Part of #508.