SectionauthorDirective
extends BaseDirective
in package
A directive is like a function you can call or apply to a block It looks like:
.. function:: main :arg1: value :arg2: otherValue
Some block !
The directive can define variables, create special nodes or change the node that directly follows it
Table of Contents
Constants
- NAME_EMAIL_REGEX = '/^(?P<name>[\w\s]+)(?: <(?P<email>[^>]+)>)?$/'
Properties
- $logger : LoggerInterface
Methods
- __construct() : mixed
- getAliases() : array<string|int, string>
- When the default domain contains a class directive, this directive will be shadowed. Therefore, Sphinx re-exports it as rst-class.
- 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>
Constants
NAME_EMAIL_REGEX
public
mixed
NAME_EMAIL_REGEX
= '/^(?P<name>[\w\s]+)(?: <(?P<email>[^>]+)>)?$/'
Tags
Properties
$logger read-only
private
LoggerInterface
$logger
Methods
__construct()
public
__construct(LoggerInterface $logger) : mixed
Parameters
- $logger : LoggerInterface
getAliases()
When the default domain contains a class directive, this directive will be shadowed. Therefore, Sphinx re-exports it as rst-class.
public
getAliases() : array<string|int, string>
See https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#rstclass
Return values
array<string|int, string>getName()
Get the directive name
public
getName() : string
Return values
stringprocess()
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
Return values
Node|nullprocessNode()
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
NodeoptionsToArray()
protected
optionsToArray(array<string|int, DirectiveOption> $options) : array<string, scalar|null>
Parameters
- $options : array<string|int, DirectiveOption>