A WordPress plugin that serves a markdown version of any post or page.
Visit /your-post-slug/md (pretty permalinks) or ?p=123&md (plain permalinks) to get the post's content as text/markdown, with a YAML frontmatter block (title, date, author, permalink) followed by the body converted from HTML to markdown.
Implemented and unit-tested. Manual QA against a live WordPress site (permalink structures, password/private posts, activation backfill, uninstall cleanup — see the plan's final task) is still outstanding before a production release. See:
- Design spec — architecture, request lifecycle, error handling, and safety decisions.
- Implementation plan — the task-by-task, test-driven build plan and manual QA checklist.
- Scope: Posts and Pages only.
- Caching: converted markdown is cached to a file under
wp-content/uploads/markout/, regenerated asynchronously (via Action Scheduler) whenever a post is saved, and self-heals on a cache miss. Writes are atomic (temp file + rename). - Visibility: mirrors WordPress's own rules exactly — private/draft content is unreachable the same way it already is, and password-protected content is denied with a 403. Password-protected posts are never written to the cache, on any code path (live request, save-triggered regeneration, or activation backfill).
- Routing: a single WordPress rewrite endpoint (
add_rewrite_endpoint('md', EP_PERMALINK)) handles both pretty and plain permalink structures.
- Copy this directory into
wp-content/plugins/markout. - Run
composer install --no-devinside it (or shipvendor/in a release build). - Activate the plugin from the WordPress admin.
If Composer dependencies or Action Scheduler are unavailable, the plugin shows an admin notice and deactivates itself rather than fataling.
- PHP 8.1+
- WordPress with Composer-managed dependencies (
league/html-to-markdown,woocommerce/action-scheduler)
PSR-4 autoloading, PSR-12 formatting, PHPStan level 8, tested with PHPUnit + Brain Monkey.
composer install
composer test # PHPUnit
composer stan # PHPStan level 8
composer cs # PHPCS (PSR-12)See the implementation plan for the full toolchain setup and per-task rationale.
GPL-2.0-or-later — see LICENSE.