vlt / affordances
  • Quickstart
  • Concepts
  • Guides
  • Reference
  • Overview
  • Setup
  • Markers
  • What gets converted
  • Caching and privacy
  • llms.txt and llms-full
  • htmlToMarkdown
  1. Plugins
  2. /
  3. Markdown for every page

Markdown for every page

@affordances/md serves every page of a Next.js app as Markdown, at /page.md and to Accept: text/markdown, from the page's own render.

Agents that don't speak the Affordances protocol still read pages, and most of a page's HTML is chrome they have to wade through. @affordances/md gives every page a Markdown twin: its content, without navigation, scripts, or controls.

There's no second source of truth. When an agent asks for Markdown, a route handler requests the page's HTML from your own app, the way a browser would, and converts it. Whatever the page renders, including data fetched on the server and content streamed into <Suspense> boundaries, is what the Markdown says.

Terminal
curl https://store.example.com/products/tee.md
curl -H 'Accept: text/markdown' https://store.example.com/products/tee

This site runs on it: add .md to any page's URL.

  • Setup: the config plugin and the route handler.
  • Markers: say exactly what to keep and what to leave out.
  • What gets converted: content, streamed boundaries, forms, code, and links.
  • Caching and privacy: what's private and what's cached.
  • llms.txt and llms-full: an index of every page for agents, and the whole site in one file, each from one line.
  • htmlToMarkdown: the converter on its own.

PreviousOverviewNextSetup
Edit this page

Make your app agent-operable

Give every page a graph and every server action an agent path: HTTP, WebMCP, and MCP, with the same session and the same checks. One command sets it up.

Read the quickstart