Skip to content
mhupfauer edited this page May 31, 2026 · 1 revision

caddy-md4agents

A Caddy v2 HTTP middleware that serves a Markdown rendition of HTML pages when a client — typically an AI agent — negotiates for it. Implements Cloudflare's Markdown for Agents convention on top of Caddy's static and dynamic handlers.

Live reference deployment: https://hupfauer.one — try curl https://hupfauer.one/ -H "Accept: text/markdown".

Docs

What it does, in one paragraph

Mounts as a Caddy handler before file_server (or any upstream). On every request it (a) decides whether the client asked for Markdown, (b) if yes, either serves an author-written *.md, a cached sidecar, or converts the HTML on the fly, (c) writes Content-Type: text/markdown; charset=utf-8 with a strong ETag and Vary: Accept. Same URL, same auth, same upstream — just a different representation.

Coverage

Coverage

View the full HTML coverage report — per-file, per-line annotated source coverage. Auto-updated by CI on every push to main.

Raw assets (updated each CI run):

  • coverage.svg — badge
  • coverage.html — full report (HTML)
  • coverage.log — coverage summary text

Links

Clone this wiki locally