=== AgentPress MD ===
Contributors: agentpress
Tags: markdown, ai, agents, llm, content-negotiation
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Generate and serve markdown versions of your WordPress content for AI agents, with .md URLs, content negotiation, and YAML frontmatter.

== Description ==

AgentPress MD automatically generates markdown versions of your posts, pages, and custom post types — making your content accessible to AI agents, LLMs, and automated tools.

= Key Features =

* **Automatic markdown generation** on publish with optional regeneration on update
* **Multiple URL formats**: `.md` extension, `?format=markdown` query parameter, and `Accept: text/markdown` content negotiation
* **YAML frontmatter** with title, date, author, categories, tags, excerpt, featured image, word count, and estimated tokens
* **Page builder support**: Gutenberg, Elementor, Bricks, Divi, Beaver Builder, WPBakery — with an extensible adapter system
* **Agent discovery endpoints**: `/.well-known/agents.json`, `/llms.txt`, and `/sitemap-md.xml`
* **In-editor integration**: View, edit, and manage markdown directly from the Gutenberg sidebar or Classic Editor
* **Bulk regeneration**: Process all existing content with a progress bar
* **Custom post type support**: Enable markdown for any public post type
* **Performance caching**: Transient-based caching for fast markdown serving
* **Dashboard widget**: Quick stats and links at a glance

= Free vs Pro =

The free version supports up to 50 markdown files. Upgrade to Pro for unlimited generation, custom frontmatter fields, and content exclusion patterns.

= How It Works =

1. Install and activate the plugin
2. Configure which post types to include in Settings → AgentPress MD
3. Publish or update a post — markdown is generated automatically
4. Access the markdown version at `yoursite.com/post-slug.md`

= For Developers =

AgentPress MD provides filters for customizing every part of the pipeline:

* `apmd_markdown_content` — modify final markdown before storage
* `apmd_frontmatter_fields` — add or modify YAML frontmatter fields
* `apmd_converter_output` — post-process HTML→markdown conversion
* `apmd_builder_adapters` — register custom page builder adapters
* `apmd_content_signal_header` — modify the Content-Signal header value

== Installation ==

1. Upload the `agentpress-md` folder to `/wp-content/plugins/`
2. Activate the plugin through the Plugins menu
3. Go to Settings → AgentPress MD to configure
4. Use the Tools tab to bulk-generate markdown for existing content

== Frequently Asked Questions ==

= Does this work with page builders? =

Yes. AgentPress MD automatically detects Elementor, Bricks, Divi, Beaver Builder, and WPBakery, and uses each builder's native rendering API to produce accurate HTML before converting to markdown.

= How do AI agents find the markdown? =

Through multiple discovery mechanisms: `<link rel="alternate">` tags in HTML, the `/.well-known/agents.json` endpoint, `/llms.txt`, the markdown sitemap, and HTTP `Accept` header content negotiation.

= What URL formats are supported? =

Three formats: `.md` extension (e.g., `example.com/my-post.md`), query parameter (`?format=markdown`), and `Accept: text/markdown` header (returns 303 redirect to `.md`).

= Can I edit the generated markdown? =

Yes. Use the AgentPress MD panel in the Gutenberg sidebar or the meta box in the Classic Editor to view, edit, or regenerate markdown for any post.

= What happens when I reach the free limit? =

At 50 markdown files, new generation pauses. Previously generated files continue to be served. Upgrade to Pro for unlimited generation.

== Changelog ==

= 1.0.4 =
* Fix settings reset when saving from a different tab
* Mask license key in admin UI after activation for security

= 1.0.2 =
* Fix deprecated load_plugin_textdomain (WordPress auto-loads since 4.6)
* Prefix all global template variables per WordPress coding standards
* Add phpcs:ignore annotations for custom database table queries
* Fix unescaped output warnings in admin templates
* Use wp_safe_redirect for internal redirects
* Add translators comments for i18n strings
* Update tested up to WordPress 6.9

= 1.0.1 =
* Code quality improvements for WordPress Plugin Check compliance
* Add inline PHPCS annotations for false-positive warnings

= 1.0.0 =
* Initial release
* HTML-to-Markdown converter with DOMDocument
* Page builder adapter system (Gutenberg, Elementor, Bricks, Divi, Beaver, WPBakery)
* YAML frontmatter generation
* URL routing with .md extension, query parameter, and content negotiation
* Agent discovery: agents.json, llms.txt, sitemap-md.xml
* Gutenberg sidebar panel and Classic Editor meta box
* Bulk regeneration with progress bar
* Transient-based caching
* Freemium licensing with external API
* Dashboard widget
* Full internationalization support
