PageDescriptor
in package
implements
JsonSerializable
FinalYes
One page of "toc.json": where it is, which files it was rendered to, its title and its anchor, and the pages its table of contents leads to.
Keys a theme adds go into PageDescriptor::setExtra(); they are written after the anchor and before the pages, so that the key a reader scrolls past last is the one that opens a subtree.
Table of Contents
Interfaces
- JsonSerializable
Properties
- $anchor : string
- $extra : array<string, mixed>
- $orphan : bool
- $outputFiles : array
- $pages : array<int, PageDescriptor>
- $path : string
- $title : string
Methods
- __construct() : mixed
- addPage() : self
- getAnchor() : string
- getExtra() : array<string, mixed>
- getOutputFiles() : array<string, string>
- getPages() : array<int, PageDescriptor>
- getPath() : string
- getTitle() : string
- isOrphan() : bool
- Whether no table of contents leads to the page.
- jsonSerialize() : array<string, mixed>
- setAnchor() : self
- setExtra() : self
- setOutputFiles() : self
- setPath() : self
- setTitle() : self
Properties
$anchor
private
string
$anchor
$extra
private
array<string, mixed>
$extra
= []
$orphan
private
bool
$orphan
= false
$outputFiles
private
array
$outputFiles
$pages
private
array<int, PageDescriptor>
$pages
= []
$path
private
string
$path
$title
private
string
$title
Methods
__construct()
public
__construct(string $path, array<string, string> $outputFiles, string $title, string $anchor[, bool $orphan = false ]) : mixed
Parameters
- $path : string
- $outputFiles : array<string, string>
-
the file per output format, keyed by the extension it writes
- $title : string
- $anchor : string
- $orphan : bool = false
addPage()
public
addPage(PageDescriptor $page) : self
Parameters
- $page : PageDescriptor
Return values
selfgetAnchor()
public
getAnchor() : string
Return values
stringgetExtra()
public
getExtra() : array<string, mixed>
Return values
array<string, mixed>getOutputFiles()
public
getOutputFiles() : array<string, string>
Return values
array<string, string>getPages()
public
getPages() : array<int, PageDescriptor>
Return values
array<int, PageDescriptor>getPath()
public
getPath() : string
Return values
stringgetTitle()
public
getTitle() : string
Return values
stringisOrphan()
Whether no table of contents leads to the page.
public
isOrphan() : bool
Return values
booljsonSerialize()
public
jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>setAnchor()
public
setAnchor(string $anchor) : self
Parameters
- $anchor : string
Return values
selfsetExtra()
public
setExtra(string $key, mixed $value) : self
Parameters
- $key : string
- $value : mixed
Return values
selfsetOutputFiles()
public
setOutputFiles(array<string, string> $outputFiles) : self
Parameters
- $outputFiles : array<string, string>
Return values
selfsetPath()
public
setPath(string $path) : self
Parameters
- $path : string
Return values
selfsetTitle()
public
setTitle(string $title) : self
Parameters
- $title : string