IndexNode
extends AbstractNode
in package
Wraps the entries collected from one `.. index::` directive occurrence.
Invisible in the rendered page body: the AbstractNode value is left an empty array so DefaultNodeRenderer renders it as '' without needing a dedicated renderer. Collected project-wide by IndexCollectorPass to build the genindex page.
A :name: on the directive makes the entries a target a :ref: can point
at. The name is only carried here; it is registered once the compiler knows
which section the entries are filed under, and points at that section.
Table of Contents
Constants
- TERMS_DATA_NAME : mixed = 'guides-index-terms'
- The data a section carries its index terms under, rendered as `data-guides-index-terms="installation,configuration"`.
Properties
- $classes : string[]
- $options : array<string, scalar|scalar[]|null>
- $value : TValue
- $entries : array
- $name : string|null
Methods
- __construct() : mixed
- addMetaData() : void
- Attaches data about this node that is not part of its content.
- getClasses() : string[]
- getClassesString() : string
- getEntries() : IndexEntryNode[]
- getMetaData() : array<string, DataNode>
- getName() : string|null
- getOption() : mixed
- getOptions() : array<string, scalar|scalar[]|null>
- getValue() : TValue
- hasOption() : bool
- setClasses() : void
- Normalizes class names following the rules of identifier-normalization
- setValue() : void
- withKeepExistingOptions() : static
- Adds $options as default options without overriding any options already set.
- withOptions() : static
Constants
TERMS_DATA_NAME
The data a section carries its index terms under, rendered as `data-guides-index-terms="installation,configuration"`.
public
mixed
TERMS_DATA_NAME
= 'guides-index-terms'
Properties
$classes
protected
string[]
$classes
= []
$options
protected
array<string, scalar|scalar[]|null>
$options
= []
$value
protected
TValue
$value
$entries read-only
private
array
$entries
$name read-only
private
string|null
$name
= null
Methods
__construct()
public
__construct(IndexEntryNode[] $entries[, string|null $name = null ]) : mixed
Parameters
- $entries : IndexEntryNode[]
- $name : string|null = null
addMetaData()
Attaches data about this node that is not part of its content.
public
addMetaData(DataNode $data) : void
Rendered as a data-* attribute where the node's template asks for
it. A name that is already taken gets the new values added to the ones
it has, rather than replaced by them. DataNode
Parameters
- $data : DataNode
getClasses()
public
getClasses() : string[]
Return values
string[]getClassesString()
public
getClassesString() : string
Return values
stringgetEntries()
public
getEntries() : IndexEntryNode[]
Return values
IndexEntryNode[]getMetaData()
public
getMetaData() : array<string, DataNode>
Return values
array<string, DataNode> —keyed by name
getName()
public
getName() : string|null
Return values
string|nullgetOption()
public
getOption(string $name[, TType|null $default = null ]) : mixed
Parameters
- $name : string
- $default : TType|null = null
Tags
getOptions()
public
getOptions() : array<string, scalar|scalar[]|null>
Return values
array<string, scalar|scalar[]|null>getValue()
public
getValue() : TValue
Return values
TValuehasOption()
public
hasOption(string $name) : bool
Parameters
- $name : string
Return values
boolsetClasses()
Normalizes class names following the rules of identifier-normalization
public
setClasses(string[] $classes) : void
Parameters
- $classes : string[]
Tags
setValue()
public
setValue(TValue $value) : void
Parameters
- $value : TValue
withKeepExistingOptions()
Adds $options as default options without overriding any options already set.
public
withKeepExistingOptions(array<string, scalar|null> $options) : static
Parameters
- $options : array<string, scalar|null>
Return values
staticwithOptions()
public
withOptions(array<string, scalar|scalar[]|null> $options) : static
Parameters
- $options : array<string, scalar|scalar[]|null>