Skip to content

Support Markdown content negotiation for docs pages #783

Description

@zahlekhan

Problem

The canonical docs URLs return HTML even when a client sends Accept: text/markdown. Processed Markdown is already available through the internal llms.mdx route, but AI agents and other Markdown clients need to know and construct a separate URL.

Expected behavior

Requests to /docs/... that prefer Markdown should return the processed documentation with Content-Type: text/markdown. Normal browser requests should continue to receive HTML.

Acceptance criteria

  • Accept: text/markdown returns a successful Markdown response from the canonical docs URL.
  • The response is served with Content-Type: text/markdown.
  • Accept: text/html continues to return the rendered HTML page.
  • Existing per-page Markdown and LLM endpoints continue to work.

Runtime verification

Tested with /docs/openui-lang:

  • Markdown request: 200 OK, rewritten to /llms.mdx/docs/openui-lang, Content-Type: text/markdown.
  • HTML request: 200 OK, Content-Type: text/html; charset=utf-8.

Related implementation

Draft PR: #782

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions