ImageDirective
extends BaseDirective
in package
FinalYes
Renders an image, example :
.. image:: image.jpg :width: 100 :title: An image
Table of Contents
Constants
- REFERENCE_ESCAPED_REGEX = '/^`([^`]+)`_$/'
- REFERENCE_REGEX = '/^([a-zA-Z0-9-_]+)_$/'
Properties
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>
- resolveLinkTarget() : LinkInlineNode
Constants
REFERENCE_ESCAPED_REGEX
public
mixed
REFERENCE_ESCAPED_REGEX
= '/^`([^`]+)`_$/'
Tags
REFERENCE_REGEX
public
mixed
REFERENCE_REGEX
= '/^([a-zA-Z0-9-_]+)_$/'
Tags
Properties
$documentNameResolver read-only
private
DocumentNameResolverInterface
$documentNameResolver
Methods
__construct()
public
__construct(DocumentNameResolverInterface $documentNameResolver) : mixed
Parameters
- $documentNameResolver : DocumentNameResolverInterface
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
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
The node that directly follows the directive is also passed to it
Parameters
- $blockContext : BlockContext
-
the current document context with the content of the directive
- $directive : Directive
-
parsed directive containing options and variable
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
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>
Return values
array<string, scalar|null>resolveLinkTarget()
private
resolveLinkTarget(string $targetReference) : LinkInlineNode
Parameters
- $targetReference : string