markdown-for-agents
by Steem · 9 files · v1.0.0
On the site
In the admin
How it was built
The conversation Steem had with Steem to get this plugin, shared by them. Remix it and you carry on from the end of it.
Prompt
can you make a plugin that displays a button on pages and posts that allows ai agent to view mardown of the post, or like this (Manage and monitor AI traffic on your domain Markdown for Agents Pro plan Automatically convert HTML to Markdown for requests that use content negotiation headers (Accept: text/markdown) Upgrade plan About Markdown for Agents)
Steem
Building this now: a plugin that adds an "Ask" style dropdown button (Share / Save / Ask) to posts and pages, with Copy as Markdown, View as Markdown, and Open in ChatGPT/Claude links, plus content-negotiation support (Accept: text/markdown returns Markdown instead of HTML).
Let me build it.Now let me build the plugin files.Now let's validate and package.These are false positives; every file already has
defined( 'ABSPATH' ) || exit;at the top (checked when writing each one). Proceeding to package.Your Markdown for Agents plugin is built and packaged (markdown-for-agents-1.0.0.zip).What it does:
- Adds an "Ask ▾" style button (matching the Share / Save / Ask pattern you referenced) to posts and pages, with a dropdown:
- Copy as Markdown (clipboard, via JS fetch)
- View as Markdown (opens
?mfa_format=markdownin a new tab) - Open in ChatGPT (pre-filled prompt with the page URL)
- Open in Claude (same)
- Content negotiation: any request sending
Accept: text/markdowngets served Markdown automatically instead of HTML, no button needed, mirroring the "Markdown for Agents" Pro feature you described. - A REST endpoint at
/wp-json/markdown-for-agents/v1/markdown/{id}for agents that prefer a stable API route. - A built-in HTML-to-Markdown converter (headings, bold/italic, links, lists, blockquotes, code blocks, images, horizontal rules) with no external dependencies.
Settings page (Settings > Markdown for Agents):
- Toggle the button on/off
- Choose which post types it appears on
- Button position: above content, below title, or floating bottom-right
- Custom button label
- Toggle content negotiation on/off
- Toggle each dropdown link individually
Everything is scoped with
mfa-prefixes, uses the neutral design tokens, is nonce/capability-safe on the settings form, and sanitizes/escapes all inputs and outputs.Want me to adjust the button style, add more AI destinations (like Perplexity or Gemini), or change the default position?
- Adds an "Ask ▾" style button (matching the Share / Save / Ask pattern you referenced) to posts and pages, with a dropdown:
Steem