Mark Don is a pair of open-source packages that makes web pages available as Markdown. A page can be requested by appending .md to its URL or by sending an Accept: text/markdown header, giving LLMs and other text-based clients a clean representation of the content.
I started the project after reading Evil Martians’ article about making websites visible to LLMs. The idea was to provide Markdown as a second representation of an existing website without having to maintain separate templates or duplicate content.
In Rails, the mark-don gem hooks into the application through a Railtie. It reuses the existing HTML views, converts the rendered page to GitHub-Flavored Markdown, and returns it with the appropriate content type. Markdown can be enabled for individual controller actions or for groups of actions.
The Astro integration takes a different approach: because Astro pages are generated statically, astro-mark-don converts them at build time and writes a .md file alongside each HTML page. The Markdown URL mirrors the original URL, making the representation easy for crawlers and AI agents to discover.
This portfolio uses astro-mark-don: every page has a corresponding Markdown version, including this one. The project is available as two open-source packages, mark-don on RubyGems and astro-mark-don on npm.
