Repository navigation
Conversation
Each doc page is served as markdown at /doc/<page>.md.md (the llms.txt convention of appending .md), with relative links made absolute and the metadata comment stripped. HTML doc pages advertise it via a rel=alternate link.
- Require a boundary after .md, and leave absolute targets, targets climbing out of the doc dir, and code fences/spans untouched - Match reference definitions indented by up to three spaces - Resolve paths with Symfony's Path::canonicalize - Redirect moved pages on the .md.md route as well - Read each doc file once for llms-full.txt and cache the text responses - Drop the precomputed link from the page listing
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.
Makes the docs easier for LLM agents to consume, following the llms.txt convention:
/llms.txt: index of the Book, Articles and FAQs (with taglines where available), each linking to its markdown version, plus the composer.json schema and changelog./llms-full.txt: all doc pages concatenated, each prefixed with its source URL./doc/<page>.md.md: raw markdown of a page (.mdappended as per the llms.txt convention, since our URLs already end in.md). Served astext/markdownwith a canonicalLinkheader pointing to the HTML page.<link rel="alternate" type="text/markdown">.The markdown is the source from
vendor/composer/composer/docwith the metadata comment stripped and relative doc links (inline, reference-style and#anchor) rewritten to the absolute markdown URLs, so they resolve both standalone and inllms-full.txt. Code fences and spans, absolute paths and targets outside the doc dir are left as is.Moved pages redirect on the markdown URLs too, and the text responses are publicly cacheable for an hour.
The page listing from the
/doc/index was extracted into a method so it is shared withllms.txt.