HighlightNodeTransformer
in package
implements
NodeTransformer
FinalYes
Applies the default highlight language, as set by the project settings or the reStructuredText `.. highlight::` directive, to every node implementing {@see ConsumesDefaultHighlightLanguage} that does not already have an explicit language.
The HighlightNode produced by the highlight directive is a marker only, it is removed from the document tree by this transformer.
Table of Contents
Interfaces
Properties
- $currentDocument : DocumentNode|null
- $currentLanguage : string|null
- $settingsManager : SettingsManager
Methods
- __construct() : mixed
- enterNode() : T
- getPriority() : int
- The higher the priority the earlier the NodeTransformer is executed.
- leaveNode() : T|null
- supports() : bool
- resetStateForNewDocument() : void
Properties
$currentDocument
private
DocumentNode|null
$currentDocument
= null
$currentLanguage
private
string|null
$currentLanguage
= null
$settingsManager read-only
private
SettingsManager
$settingsManager
Methods
__construct()
public
__construct(SettingsManager $settingsManager) : mixed
Parameters
- $settingsManager : SettingsManager
enterNode()
public
enterNode(Node $node, CompilerContextInterface $compilerContext) : T
Parameters
- $node : Node
- $compilerContext : CompilerContextInterface
Return values
TgetPriority()
The higher the priority the earlier the NodeTransformer is executed.
public
getPriority() : int
Return values
intleaveNode()
public
leaveNode(Node $node, CompilerContextInterface $compilerContext) : T|null
Parameters
- $node : Node
- $compilerContext : CompilerContextInterface
Return values
T|nullsupports()
public
supports(Node $node) : bool
Parameters
- $node : Node
Return values
boolresetStateForNewDocument()
private
resetStateForNewDocument(CompilerContextInterface $compilerContext) : void
Parameters
- $compilerContext : CompilerContextInterface