Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #486. Page Markdown responses (content negotiation and
/markdown/URLs) are now converted from the page's rendered HTML, with Wagtail 8.1'sHTMLToMarkdownConverter. Until now, they were built from the page content alone.Depends on the Wagtail 8.1 upgrade (separate PR), as the converter is new in 8.1. I tested this on 8.1rc1 without upgrading.
Why: today's Markdown pages leave out what visitors see around the content. Section pages don't list their pages, and nothing links to llms.txt. The homepage has 5 links in Markdown against 47 in HTML, and Releases has 0 against 16. In the agent readiness evals (#508), agents often couldn't find the right page from Markdown, and the same site without Markdown did as well or better.
Changes:
MarkdownRouteMixin.to_markdown_from_htmlconverts the whole<body>(content_selector="body"), so section page listings and the links to llms.txt and llms-full.txt are kept. The converter already leaves out<nav>.data-markdown-ignore.to_markdownis unchanged, as llms-full.txt and the MCP server still use it.Eval results (3 repeats, all 33 questions)
The evals ran on a prototype using a copy of the converter adapted to Wagtail 8.0. See RESULTS.md in the evals PR.
Testing
All tests and ruff pass on Wagtail 8.1rc1, and I checked real pages from a production database copy.
AI disclosure
AI-assisted feature and running the evals.