WP Manifestindependent plugin directory
manifest / ai / dot-md

Dot MD

WordPress plugin to generate a markdown version of a post when /md/ or .md is appended to the post URL.

★ 2stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/ideadude/dot-md/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Convert WordPress posts to Markdown with a simple URL pattern

A simple WordPress plugin that lets you view or download any post/page as Markdown by adding /md/ or .md to the URL.

Quick Start

# Clone the repo
git clone https://github.com/ideadude/dot-md.git

# Move to WordPress plugins directory
mv dot-md /path/to/wordpress/wp-content/plugins/

# Activate in WordPress admin

Usage

View in Browser

Add /md/ to any post URL:

https://example.com/my-post/      → Original
https://example.com/my-post/md/   → Markdown (displays in browser)

Download File

Add .md to any post URL (requires web server configuration):

https://example.com/my-post.md    → Downloads markdown file

Installation & Configuration

1. Install Plugin

  • Upload to /wp-content/plugins/dot-md/
  • Activate via WordPress admin
  • /md/ endpoint works immediately

2. Configure Web Server (Optional)

To enable .md downloads, add a rewrite rule:

Apache (.htaccess)

Add before standard WordPress rules:

# Custom rule for .md downloads
RewriteRule ^(.+)\.md$ /$1/md/?download=1 [QSA,L]

Nginx

Add to server block:

rewrite ^/(.+)\.md$ /$1/md/?download=1 last;

Features

  • 🚀 Zero Config - Works immediately after activation
  • 📝 Smart Conversion - Handles headers, lists, links, images, code, tables, blockquotes
  • ⚡ Cached - Generated markdown cached for 1 week, auto-refreshed on updates
  • 🎯 Two Modes - View in browser or download file
  • 🔧 Developer Friendly - Filterable output, clean code
  • 📊 Metadata - Includes title, date, author, permalink in every file

Use Cases

  • AI Integration: Feed content to Claude, ChatGPT, or other LLMs
  • Content Migration: Export to static site generators (Hugo, Jekyll, etc.)
  • Documentation: Quick export for developer docs
  • Archival: Backup content in portable format
  • Cross-platform: Share content in universal format

Developer API

Filters

dotmd_markdown_output - Modify markdown before output

add_filter( 'dotmd_markdown_output', function( $markdown, $post ) {
    // Add custom footer
    $markdown .= "\n\n---\nGenerated by My Company";
    return $markdown;
}, 10, 2 );

Cache Management

Markdown is cached using WordPress transients:

  • Key pattern: dotmd_{post_id}_v{version}
  • Duration: 1 week
  • Auto-cleared on: Post update, post deletion

How It Works

  1. Detect - WordPress rewrite endpoint catches /md/ in URL
  2. Convert - HTML → Markdown using league/html-to-markdown (namespaced to DotMD\HtmlToMarkdown)
  3. Cache - Store result in transient for 1 week
  4. Serve - Output with appropriate headers (inline or attachment)

Custom Converters

This plugin extends the base league/html-to-markdown library with custom converters for cleaner, more AI-friendly markdown output:

SemanticConverter

Strips semantic HTML5 tags while preserving content:

  • <article>, <header>, <section>, <footer>, <main>, <aside>, <nav>
  • <figure>, <figcaption>, <cite>, <span>

InlineFormatConverter

Handles additional inline formatting:

  • <s>, <del>, <strike> → ~~strikethrough~~
  • <u> and <mark> → stripped (no markdown equivalent)

InputConverter

Converts HTML form inputs to markdown equivalents:

  • <input type="checkbox" checked> → [x] (task lists)
  • <input type="checkbox"> → [ ] (task lists)

DetailsConverter

Handles collapsible HTML5 details/summary:

  • <summary> → **bold summary text**
  • <details> → clean content blocks

IframeConverter

Converts embedded iframes to clean links:

  • `