Guides

Directive
in package

FinalYes
Attributes
#[Attribute]
\Attribute::TARGET_CLASS

Table of Contents

Properties

$aliases  : array
$name  : string
$rawContent  : bool
$valueType  : DirectiveValueType

Methods

__construct()  : mixed

Properties

$aliases read-only

public array $aliases = []

$rawContent read-only

public bool $rawContent = false

Methods

__construct()

public __construct(string $name[, string[] $aliases = [] ][, bool $rawContent = false ][, DirectiveValueType $valueType = DirectiveValueType::Inline ]) : mixed
Parameters
$name : string
$aliases : string[] = []
$rawContent : bool = false

If set, the directive's body is captured as literal source text (DirectiveNode::getRawContent()) instead of being parsed into child nodes -- for directives whose content isn't reStructuredText (e.g. raw HTML/LaTeX passthrough). Parsing such content as RST would corrupt it (e.g. a line that looks like a section title gets misinterpreted), so it's skipped entirely rather than parsed and discarded.

$valueType : DirectiveValueType = DirectiveValueType::Inline

What kind of value this directive accepts right after :: -- see DirectiveValueType. Defaults to Inline, matching every directive's behavior before this was introduced: a non-empty value is always parsed as inline markup.

On this page

Search results