Guides

TocRenderer
in package
implements TypeRenderer

FinalYes

The table of contents of a manual as one JSON file.

"toc.json" at the root of a rendered manual: what pages there are, in the order the table of contents puts them and nested the way it nests them, each with its title and the anchor a reference to it is built from.

A tool that wants to read a manual has to learn its shape first, and nothing published so far says it. "objects.inv.json" comes closest, but it is an index rather than a table of contents: a flat map without order or nesting, which repeats the project title and version in every one of its entries and knows only ".html" addresses. This file states those once, at the top, and leaves each page with what belongs to the page alone. For a manual the size of TYPO3 Explained that is 348 KB against 4.2 MB.

Everything here is what any project knows about itself. A theme that knows more -- how its pages are addressed, what else a page carries -- adds it through ModifyTocProject and ModifyTocPage.

Table of Contents

Interfaces

TypeRenderer

Constants

FORMAT  : mixed = 'llm_toc'
The output format that writes this file.

Properties

$anchorNormalizer  : AnchorNormalizer
$eventDispatcher  : EventDispatcherInterface
$outputFiles  : DocumentOutputFiles

Methods

__construct()  : mixed
render()  : void
anchor()  : string
The label a reference to the page is built from, or "" when it has none.
collect()  : void
describe()  : PageDescriptor
One page and, nested below it, the pages its table of contents leads to.
orphans()  : array<int, DocumentEntryNode>
Every page no table of contents leads to, in the order the project knows them.
project()  : TocProject
What the manual says about itself, once.

Constants

FORMAT

The output format that writes this file.

public mixed FORMAT = 'llm_toc'

Properties

$eventDispatcher read-only

private EventDispatcherInterface $eventDispatcher

Methods

anchor()

The label a reference to the page is built from, or "" when it has none.

private anchor(DocumentEntryNode $entry, DocumentNode|null $document) : string

The explicit label of the first section, the way a ":ref:" to the page names it, and otherwise the id derived from its title -- which the inventory registers as well, so a reference built on it resolves.

Parameters
$entry : DocumentEntryNode
$document : DocumentNode|null
Return values
string
On this page

Search results