Markdown for Agents
Any documentation page on MotionRail can be requested as markdown by sending an Accept: text/markdown header. A Cloudflare Pages middleware converts the HTML to markdown on-the-fly using Turndown.
Usage
bash
curl -H "Accept: text/markdown" https://motionrail.jujiplay.com/docs/installationbash
curl -H "Accept: text/markdown" https://motionrail.jujiplay.com/docs/api/class/motionrailbash
curl -H "Accept: text/markdown" https://motionrail.jujiplay.com/docs/quick-startHow it works
- Request comes in with
Accept: text/markdown - The Pages Function middleware intercepts it
- Fetches the rendered HTML page
- Converts HTML to markdown via Turndown
- Returns
Content-Type: text/markdown
Use cases
- AI agents consuming documentation for context
- Integrating documentation into training pipelines
- Getting a plain-text version of any page