Skip to content

Commit 9ea3714

Browse files
jaapiolinawolf
authored andcommitted
Add reference docs
1 parent bf395fd commit 9ea3714

File tree

8 files changed

+62
-46
lines changed

8 files changed

+62
-46
lines changed

docs/about.rst

Lines changed: 0 additions & 35 deletions
This file was deleted.

docs/reference/restructuredtext/text-roles.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ You can also :doc:`add your own custom text roles </extension/text-roles>`.
1010

1111
Currently the following text roles are implemented:
1212

13+
.. phpdoc:class-list:: [?(@.interfacesIncludingInherited contains "\phpDocumentor\Guides\RestructuredText\TextRoles\TextRole")]
14+
15+
.. phpdoc:name::
16+
:title: true
17+
:level: 2
18+
19+
.. phpdoc:summary::
20+
.. phpdoc:description::
21+
22+
23+
Examples
24+
========
25+
1326
:ref:`Reference somewhere <basic-text-role>`
1427

1528
:doc:`Reference to document </extension/text-roles>`

packages/guides-restructured-text/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';

packages/guides-restructured-text/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';

packages/guides-restructured-text/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> */

packages/guides-restructured-text/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';

packages/guides-restructured-text/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';

packages/guides-restructured-text/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)