DocReferenceTextRole
extends AbstractReferenceTextRole
in package
FinalYes
Role to create a reference to a document.
Example:
:doc:`doc/index`
Table of Contents
Constants
- NAME = 'doc'
Properties
- $useRawContent : bool
- $interlinkParser : InterlinkParser
- $referenceRegex : string
- https://regex101.com/r/KadqKx/1
Methods
- __construct() : mixed
- getAliases() : array<string|int, string>
- getName() : string
- processNode() : AbstractLinkInlineNode
- createNode() : DocReferenceNode
- extractEmbeddedReference() : ReferenceData
Constants
NAME
public
final mixed
NAME
= 'doc'
Properties
$useRawContent
protected
bool
$useRawContent
= false
$interlinkParser read-only
private
InterlinkParser
$interlinkParser
$referenceRegex
https://regex101.com/r/KadqKx/1
private
string
$referenceRegex
= '/^(.*?)(<([^<]+)>)?$/s'
Methods
__construct()
public
__construct(InterlinkParser $interlinkParser) : mixed
Parameters
- $interlinkParser : InterlinkParser
getAliases()
public
getAliases() : array<string|int, string>
Tags
Return values
array<string|int, string>getName()
public
getName() : string
Return values
stringprocessNode()
public
processNode(DocumentParserContext $documentParserContext, string $role, string $content, string $rawContent) : AbstractLinkInlineNode
Parameters
- $documentParserContext : DocumentParserContext
- $role : string
- $content : string
-
the content with backslash escapes removed per spec
- $rawContent : string
-
the raw content, including backslash escapes
Return values
AbstractLinkInlineNodecreateNode()
protected
createNode(string $referenceTarget, string|null $referenceName, string $role) : DocReferenceNode
Parameters
- $referenceTarget : string
- $referenceName : string|null
- $role : string
Return values
DocReferenceNodeextractEmbeddedReference()
private
extractEmbeddedReference(string $text) : ReferenceData
Parameters
- $text : string