Next.js โ Markdown
Serve Markdown from any Next.js page
Built for how you ship
Use cases that just work with your existing Next.js setup.
AI crawlers & LLM ingestion
Expose your content as Markdown for indexing and LLM pipelines without changing your app.
Documentation exports
One command to get Markdown from docs sites for offline use or migration.
Content syndication
Reuse the same pages in other systems, newsletters, or tools that consume Markdown.
SEO & tooling
Provide alternate representations for analysis, audits, and content portability.
Zero page changes
Middleware intercepts requests; your components stay HTML. No Puppeteer, no custom server.
How it works
No custom server, no edits to your page components.
Middleware intercepts
Requests with Accept: text/markdown are rewritten to an internal handler.
Same URL, HTML first
The handler fetches your page as HTML (your app renders once), then converts HTML โ Markdown.
Clean Markdown out
Nav/footer stripped, headings/links/images/tables preserved. Response can be cached.
Install in one command
From your Next.js project root. Init detects App vs Pages Router and sets up middleware and handler.
$ npx accept-md init # Then install deps $ pnpm install
Full documentation โ config, CLI (doctor, fix-routes), and manual setup.
Ready to serve Markdown?
Add accept-md to your Next.js app and keep your pages unchanged.