Add Markdown Feeds experiment#194
Conversation
- Add feed autodiscovery links in HTML head - Add Link rel=canonical header for .md URLs - Add post visibility checks (private, password-protected) - Add HTTP caching (Last-Modified, ETag, 304 responses) - Add table, figure/figcaption, and cite tag support - Refactor .md URL handling to use request filter - Fix leading whitespace in output - Add comprehensive test coverage
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #194 +/- ##
=============================================
- Coverage 50.80% 49.62% -1.19%
- Complexity 375 610 +235
=============================================
Files 27 31 +4
Lines 1978 2827 +849
=============================================
+ Hits 1005 1403 +398
- Misses 973 1424 +451
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…hin the Experiment is on a later priority
|
Marking this as an open PR so we can get this merged. @m and others are quite interested in this feature |
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
We have some pretty URL prior art here with /feed/[format] that we should support in addition to the query string. This would be the first time we introduce dots into WP's canonical URL structures... how should we think about that? Remember that we have other things that exist in the hierarchy of the permalink itself, so when you make the permalink a filename you lose that ability to have sub-directories or files. |
|
@Jameswlepage before we move for review, I think Matt raised some questions that we should settle out before proceeding. Did you have immediate reactions to those questions (especially in case you've had conversations on this topic that would inform approach here)? If not, then I can look to sort through those with Darin to get this PR back on track towards review. |
|
Ah shoot, I didn't actually push up my changes. Yeah, I agree with Matt on the file extension. I'm seeing it as a common convention, so my inclination is to keep it but default to a format query parameter instead of the extension by default. I am not on my desktop right now, so I'll see if I can get that up soon. |
Summary
Adds Markdown representations of WordPress content for feeds and singular views:
/?feed=markdownwith autodiscovery links.mdpermalinks andAccept: text/markdownWP_HTML_Processorwith fallback toWP_HTML_Tag_ProcessorImplementation Details
Markdown_Feedsregisters the feed,.mdparsing, and Accept header negotiationHTML_To_Markdown_Converteruses the WordPress HTML API to produce Markdown.mdpermalinks, and Accept header negotiationai_experiments_markdown_feed_post_sectionsandai_experiments_markdown_singular_post_sectionsTest plan
/?feed=markdownand confirmtext/markdownoutput/hello-world.mdand confirmtext/markdownoutputAccept: text/markdownand confirm Markdown outputnpm run test:php -- --filter Markdown_Feeds