Skip to content

Markdown feeds experiment - #855

Open
dkotter wants to merge 10 commits into
WordPress:developfrom
dkotter:feature/markdown-feeds
Open

Markdown feeds experiment#855
dkotter wants to merge 10 commits into
WordPress:developfrom
dkotter:feature/markdown-feeds

Conversation

@dkotter

@dkotter dkotter commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What?

Closes #845

Adds a new experiment, Markdown Feeds, that when enabled introduces new markdown feeds for singular content and main archive feeds.

Why?

Having the ability to return content in markdown is useful for many situations, particularly for AI agents and machine readers.

How?

  • Introduce a new Markdown_Feeds experiment class that registers needed hooks
  • Introduce new feed renderer classes, Markdown_Singular_Renderer and Markdown_Feed_Renderer, that will render markdown for singular feeds and normal feeds
  • Introduce a Markdown_Converter class that provides a wrapper for converting HTML to Markdown
  • Pull in the HTML to MD package to use for the actual conversion. Decided to pull this in to our custom includes/Vendor directory (alongside our encryption package) instead of including this at build time via composer. Ensure the file names match our autoloading process and add custom namespaces to avoid conflicts with other plugins using the same tool
  • Adds a new setting that is off by default but when turned on tries to automatically serve the markdown feed if the request sends Accept: text/markdown
  • An autodiscovery link tag for the Markdown feed is printed in the <head> tag as well
  • Two filters added to change the contents of the feeds: wpai_markdown_singular_sections and wpai_markdown_feed_item_sections

To access a normal markdown feed, take the feed URL and append /markdown or ?feed=markdown, depending on if pretty permalinks are in use. Examples: https://example.com/feed/markdown, https://example.com/category/news/feed/markdown

To access a singular markdown feed, access the URL and append ?format=md, example: https://example.com/this-is-an-article?format=md.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Fable 5, Opus 4.8
Used for: Putting together a plan and executing on that plan. Plan reviewed and modified by me and all code was reviewed and tested by me

Testing Instructions

  1. Pull this PR down
  2. Go to Settings > AI and enable Markdown Feeds
  3. Ensure you have pretty permalinks on and have some content created
  4. Go to your homepage and append /feed/markdown
  5. Ensure a markdown feed is shown
  6. Go to a single piece of content and append ?format=md
  7. Ensure a markdown feed is shown
  8. Inspect the source of a post or page and ensure you see a link tag pointing to the markdown feed

Screenshots or screencast

Markdown Feeds settings Example of a singular markdown feed

Changelog Entry

Added - New experiment, Markdown Feeds, that creates markdown feeds at /feed/markdown/ (available in every feed context) and of individual posts and pages via ?format=md

Open WordPress Playground Preview

@dkotter dkotter added this to the Future Release milestone Jul 10, 2026
@dkotter dkotter self-assigned this Jul 10, 2026
@dkotter
dkotter requested a review from a team July 10, 2026 15:59
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.86486% with 251 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.33%. Comparing base (7660347) to head (2f2aa87).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...Html_To_Markdown/WP_Experimental_HTML_Renderer.php 67.52% 88 Missing ⚠️
...kdown/WP_Experimental_HTML_Renderer_Block_List.php 54.23% 27 Missing ⚠️
...down/WP_Experimental_HTML_Renderer_Line_Buffer.php 78.26% 25 Missing ⚠️
...WP_Experimental_HTML_Renderer_Block_Blockquote.php 0.00% 23 Missing ⚠️
...down/WP_Experimental_HTML_Renderer_Format_Link.php 58.69% 19 Missing ⚠️
...udes/Experiments/Markdown_Feeds/Markdown_Feeds.php 83.67% 16 Missing ⚠️
...own/WP_Experimental_HTML_Renderer_Line_Wrapper.php 77.77% 12 Missing ⚠️
...kdown/WP_Experimental_HTML_Renderer_Block_Code.php 84.93% 11 Missing ⚠️
...o_Markdown/WP_Experimental_HTML_Renderer_Block.php 12.50% 7 Missing ⚠️
...own/WP_Experimental_HTML_Renderer_Format_Image.php 0.00% 6 Missing ⚠️
... and 8 more
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #855      +/-   ##
=============================================
- Coverage      76.68%   76.33%   -0.36%     
- Complexity      2201     2537     +336     
=============================================
  Files            100      118      +18     
  Lines           9080    10005     +925     
=============================================
+ Hits            6963     7637     +674     
- Misses          2117     2368     +251     
Flag Coverage Δ
unit 76.33% <72.86%> (-0.36%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dkotter dkotter modified the milestones: Future Release, 1.3.0 Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New Experiment: Markdown feeds (powered by html-to-md)

1 participant