Repository navigation
Conversation
linawolf
force-pushed
the
task/guides-llms-toc-json
branch
2 times, most recently
from
September 20, 2026 11:28
3c220eb to
06132d1
Compare
linawolf
force-pushed
the
task/guides-llms-toc-json
branch
from
October 4, 2026 10:41
06132d1 to
df58eba
Compare
jaapio
reviewed
Oct 4, 2026
jaapio
left a comment
Member
There was a problem hiding this comment.
The naming of guides-llms seems to be a bit off. I don't like the name. But I do have a hard time to suggest a better name.
The purpose of this extension is to improve the LLM accessibility of the docs generated by guides right? Maybe we should include that into the name. Because this package is not doing anything with an llm.
linawolf
force-pushed
the
task/guides-llms-toc-json
branch
2 times, most recently
from
October 5, 2026 14:40
4788c69 to
b572528
Compare
A rendered manual says a great deal about each of its pages and nothing about itself as a whole. A tool that wants to read one -- a search index, an agent, a script collecting release notes -- has to crawl it to learn what pages there are and how they hang together. "objects.inv.json" comes closest, but it is an index rather than a table of contents: flat, without order or nesting, repeating the project title and version in every entry and knowing only ".html" addresses. For the 985 pages of TYPO3 Explained 14.3 that is 4.2 MB, against the 568 KB this file needs. Add an "llm_toc" output format in a new package, guides-machine-readable, which collects the output that describes a manual to the tools and language models that read it rather than to a person. What a reader gets from the rendered pages and the navigation around them, a program has to be told; the table of contents is the first of that, and more is expected to follow. Enabling the extension is all there is to it. Which files a page is named as follows from the output formats the project configured. The library already treats a format as the extension it writes, so a project rendering HTML and Markdown names both, and a format that writes a single file for the whole project names no page at all. That answer is a public service of its own, so anything else describing pages can reuse it rather than keep a second list of formats. Two events let a theme add what only it knows -- ModifyTocProjectInfo for the project section, ModifyTocPageEntry for every page. They pass the section and each page as objects, TocProject and PageDescriptor, so a downstream theme can correct values or add its own keys, like its permalinks and version rule, without forking the file. Ported from TYPO3-Documentation/render-guides, where it has shipped since 0.42 and feeds docs.typo3.org. Signed-off-by: linawolf Assisted-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Assisted-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
linawolf
force-pushed
the
task/guides-llms-toc-json
branch
from
October 5, 2026 14:49
b572528 to
bf62475
Compare
linawolf
marked this pull request as ready for review
October 10, 2026 09:10
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.
A rendered manual says a great deal about each of its pages and nothing
about itself as a whole. A tool that wants to read one -- a search index,
an agent, a script collecting release notes -- has to crawl it to learn
what pages there are and how they hang together. "objects.inv.json" comes
closest, but it is an index rather than a table of contents: flat, without
order or nesting, repeating the project title and version in every entry
and knowing only ".html" addresses. For the 985 pages of TYPO3 Explained
14.3 that is 4.2 MB, against the 568 KB this file needs.
Add an "llm_toc" output format in a new package,
guides-machine-readable, which collects the output that describes a
manual to the tools and language models that read it rather than to a
person. What a reader gets from the rendered pages and the navigation
around them, a program has to be told; the table of contents is the
first of that, and more is expected to follow. Enabling the extension is
all there is to it.
Which files a page is named as follows from the output formats the project
configured. The library already treats a format as the extension it writes,
so a project rendering HTML and Markdown names both, and a format that
writes a single file for the whole project names no page at all. That
answer is a public service of its own, so anything else describing pages
can reuse it rather than keep a second list of formats.
Two events let a theme add what only it knows -- ModifyTocProjectInfo
for the project section, ModifyTocPageEntry for every page. They pass
the section and each page as objects, TocProject and PageDescriptor, so
a downstream theme can correct values or add its own keys, like its
permalinks and version rule, without forking the file.
Ported from TYPO3-Documentation/render-guides, where it has shipped since
0.42 and feeds docs.typo3.org.
Signed-off-by: linawolf
Assisted-By: Claude Opus 5 (1M context) noreply@anthropic.com
Assisted-By: Claude Opus 5.5 (1M context) noreply@anthropic.com
What it looks like
This is the whole of
toc.jsonfor the integration fixture added here --three pages in two levels, plus one no toctree reaches:
{ "project": { "title": "Table of contents", "version": "2.0" }, "pages": [ { "path": "index", "html": "index.html", "title": "Table of contents", "anchor": "toc-start", "pages": [ { "path": "Chapter/Index", "html": "Chapter/Index.html", "title": "Chapter", "anchor": "toc-chapter", "pages": [ { "path": "Chapter/Page", "html": "Chapter/Page.html", "title": "A page with no label", "anchor": "a-page-with-no-label" } ] } ] }, { "orphan": true, "path": "Orphan", "html": "Orphan.html", "title": "Orphan", "anchor": "toc-orphan" } ] }A live example
TYPO3 has published this file since render-guides 0.42, so there is a real
one to look at rather than a fixture:
https://docs.typo3.org/m/typo3/reference-coreapi/14.3/en-us/toc.json
985 pages, 3 of them orphans. It carries two keys this PR leaves to the
theme --
project.permalinkand themdfile beside eachhtmlone --both added through
ModifyTocProjectInfoand the output formats, with nochange to the generic file.