Guides

DocumentOutputFiles
in package

FinalYes

The files one page of the manual was rendered to.

A page can exist several times over -- as ".html" and as ".md", say -- and a reader should be able to follow a link to the form it wants rather than having to know which extension turns a bare path into a file.

Only the forms that were rendered are named: a link to a file that is not there would be worse than no link. Which those are follows from the output formats the project configured, minus the ones that write something other than a file per page. A format is the extension it writes -- that is the rule the whole library generates URLs by, @see \phpDocumentor\Guides\Renderer\UrlGenerator\AbstractUrlGenerator::createFileUrl() -- so "md" is named ".md" without this class having to have heard of Markdown, and a format added by an extension is named the same way.

The question is not peculiar to the table of contents, so this is a public service under its own class name: anything else writing about pages can inject it instead of keeping a second list of output formats that drifts from this one.

Table of Contents

Properties

$formats  : array<int, string>|null
$settingsManager  : SettingsManager
$typeRendererFactory  : TypeRendererFactory

Methods

__construct()  : mixed
of()  : array<string, string>
formats()  : array<int, string>
The configured output formats that write one file per page.

Properties

Methods

of()

public of(string $path) : array<string, string>
Parameters
$path : string

the page within the manual, without an extension

Return values
array<string, string> —

the page's file per format, in the order the project configured the formats

formats()

The configured output formats that write one file per page.

private formats() : array<int, string>

"interlink" and "llm_toc" write a single file for the whole manual, a single-page format writes one file for all pages at once; none of them gives a page a file of its own. What separates them from the rest is that the others render document by document, which is what BaseTypeRenderer does and what they are all built on.

Return values
array<int, string>
On this page

Search results