Guides

ToctreeDirective extends BaseDirective
in package

FinalYes

Sphinx based Toctree directive.

This directive has an issue, as the related documents are resolved on parse, but during the rendering we are using the Metas to collect the titles of those documents. There is some step missing in our process which could be resolved by using https://github.com/phpDocumentor/guides/pull/21?

Tags
link

Parameters:

:caption: (Text with inline markup) Caption to be displayed above the menu

:depth: (integer) Maximum depth of the menu to display. Does not affect other menus.

:glob: (bool) If true glob patterns containing stars are considered during menu building. The entries are added to the Document Tree. Orphans are ignored

:globExclude: (comma separated string list) paths to be excluded from the glob patterns

:hidden: (bool) The menu will not be displayed within the content and is only used to change the global document tree.

:reversed: (bool) Display documents in reversed order. They are also added to the document tree in reversed order and will be displayed in that order where ever a menu is displayed

:titlesonly: Do not display the headlines of the current or sub documents, only display page titles.

:maxdepth: Synonym of :depth:, depth prevails if both are set.

Table of Contents

Properties

$settingsManager  : SettingsManager
$startingRule  : Rule
$toctreeBuilder  : ToctreeBuilder

Methods

__construct()  : mixed
getAliases()  : array<string|int, string>
Allow a directive to be registered under multiple names.
getName()  : string
Get the directive name
process()  : Node|null
This is the function called by the parser to process the directive, it can be overloaded to do anything with the document, like tweaking nodes or change the parser context
processNode()  : Node
This can be overloaded to write a directive that just create one node for the document, which is common
optionsToArray()  : array<string, scalar|null>

Properties

Methods

getAliases()

Allow a directive to be registered under multiple names.

public getAliases() : array<string|int, string>

Aliases can be used for directives whose name has been deprecated or allows for multiple spellings.

Return values
array<string|int, string>

getName()

Get the directive name

public getName() : string
Return values
string

process()

This is the function called by the parser to process the directive, it can be overloaded to do anything with the document, like tweaking nodes or change the parser context

public process(BlockContext $blockContext, Directive $directive) : Node|null
Parameters
$blockContext : BlockContext

the current document context with the content of the directive

$directive : Directive

parsed directive containing options and variable

Return values
Node|null

processNode()

This can be overloaded to write a directive that just create one node for the document, which is common

public processNode(BlockContext $blockContext, Directive $directive) : Node

The arguments are the same that process

Parameters
$blockContext : BlockContext
$directive : Directive
Return values
Node

optionsToArray()

protected optionsToArray(array<string|int, DirectiveOption$options) : array<string, scalar|null>
Parameters
$options : array<string|int, DirectiveOption>
Return values
array<string, scalar|null>

        
On this page

Search results