Skip to content

Commit 4850cea

Browse files
jaapiolinawolf
authored andcommitted
Add reference docs
1 parent 2344d8e commit 4850cea

File tree

6 files changed

+49
-11
lines changed

6 files changed

+49
-11
lines changed

src/RestructuredText/TextRoles/AbbreviationTextRole.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
use function preg_match;
2222
use function trim;
2323

24+
/**
25+
* Role to create an abbreviation.
26+
*
27+
* Example:
28+
*
29+
* ```rest
30+
* :abbreviation:`term (some term definition)`
31+
* ```
32+
*/
2433
final class AbbreviationTextRole extends BaseTextRole
2534
{
2635
protected string $name = 'abbreviation';

src/RestructuredText/TextRoles/DocReferenceTextRole.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
use phpDocumentor\Guides\Nodes\Inline\DocReferenceNode;
1818
use phpDocumentor\Guides\RestructuredText\Parser\Interlink\InterlinkParser;
1919

20+
/**
21+
* Role to create a reference to a document.
22+
*
23+
* Example:
24+
*
25+
* ```rest
26+
* :doc:`doc/index`
27+
* ```
28+
*/
2029
final class DocReferenceTextRole extends AbstractReferenceTextRole
2130
{
2231
final public const NAME = 'doc';

src/RestructuredText/TextRoles/GenericLinkProvider.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515

1616
use phpDocumentor\Guides\Nodes\SectionNode;
1717

18+
/**
19+
* Role to create references to link targets.
20+
*
21+
* Example:
22+
*
23+
* ```rest
24+
* :ref:`label`
25+
* ```
26+
*/
1827
final class GenericLinkProvider
1928
{
2029
/** @var array<string, string> */

src/RestructuredText/TextRoles/LiteralTextRole.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@
1616
use phpDocumentor\Guides\Nodes\Inline\GenericTextRoleInlineNode;
1717
use phpDocumentor\Guides\RestructuredText\Parser\DocumentParserContext;
1818

19+
/**
20+
* Role to create a literal block.
21+
*
22+
* A literal block is a block of text that is displayed as-is, without any formatting.
23+
*
24+
* Example:
25+
*
26+
* ```rest
27+
* :literal:`code`
28+
* ```
29+
*/
1930
final class LiteralTextRole extends BaseTextRole
2031
{
2132
protected string $name = 'literal';

src/RestructuredText/TextRoles/MathTextRole.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@
1616
use phpDocumentor\Guides\Nodes\Inline\GenericTextRoleInlineNode;
1717
use phpDocumentor\Guides\RestructuredText\Parser\DocumentParserContext;
1818

19+
/**
20+
* Role to create a math block.
21+
*
22+
* A math block is a block of text that is displayed as-is, without any formatting.
23+
*
24+
* Example:
25+
*
26+
* ```rest
27+
* :math:`code`
28+
* ```
29+
*/
1930
final class MathTextRole extends BaseTextRole
2031
{
2132
protected string $name = 'math';

src/RestructuredText/TextRoles/SpanTextRole.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,6 @@
1616
use phpDocumentor\Guides\Nodes\Inline\GenericTextRoleInlineNode;
1717
use phpDocumentor\Guides\RestructuredText\Parser\DocumentParserContext;
1818

19-
/**
20-
* This text role is extended by custom text roles that do not feature a base text role:
21-
*
22-
* ```
23-
* .. role:: custom
24-
* :class: special
25-
*
26-
* :custom:`interpreted text`
27-
*
28-
* ```
29-
*/
3019
final class SpanTextRole extends BaseTextRole
3120
{
3221
protected string $name = 'span';

0 commit comments

Comments
 (0)