Skip to content

Commit

Permalink
Add reference docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jaapio authored and linawolf committed Feb 18, 2024
1 parent 2344d8e commit 4850cea
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 11 deletions.
9 changes: 9 additions & 0 deletions src/RestructuredText/TextRoles/AbbreviationTextRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@
use function preg_match;
use function trim;

/**
* Role to create an abbreviation.
*
* Example:
*
* ```rest
* :abbreviation:`term (some term definition)`
* ```
*/
final class AbbreviationTextRole extends BaseTextRole
{
protected string $name = 'abbreviation';
Expand Down
9 changes: 9 additions & 0 deletions src/RestructuredText/TextRoles/DocReferenceTextRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
use phpDocumentor\Guides\Nodes\Inline\DocReferenceNode;
use phpDocumentor\Guides\RestructuredText\Parser\Interlink\InterlinkParser;

/**
* Role to create a reference to a document.
*
* Example:
*
* ```rest
* :doc:`doc/index`
* ```
*/
final class DocReferenceTextRole extends AbstractReferenceTextRole
{
final public const NAME = 'doc';
Expand Down
9 changes: 9 additions & 0 deletions src/RestructuredText/TextRoles/GenericLinkProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@

use phpDocumentor\Guides\Nodes\SectionNode;

/**
* Role to create references to link targets.
*
* Example:
*
* ```rest
* :ref:`label`
* ```
*/
final class GenericLinkProvider
{
/** @var array<string, string> */
Expand Down
11 changes: 11 additions & 0 deletions src/RestructuredText/TextRoles/LiteralTextRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@
use phpDocumentor\Guides\Nodes\Inline\GenericTextRoleInlineNode;
use phpDocumentor\Guides\RestructuredText\Parser\DocumentParserContext;

/**
* Role to create a literal block.
*
* A literal block is a block of text that is displayed as-is, without any formatting.
*
* Example:
*
* ```rest
* :literal:`code`
* ```
*/
final class LiteralTextRole extends BaseTextRole
{
protected string $name = 'literal';
Expand Down
11 changes: 11 additions & 0 deletions src/RestructuredText/TextRoles/MathTextRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@
use phpDocumentor\Guides\Nodes\Inline\GenericTextRoleInlineNode;
use phpDocumentor\Guides\RestructuredText\Parser\DocumentParserContext;

/**
* Role to create a math block.
*
* A math block is a block of text that is displayed as-is, without any formatting.
*
* Example:
*
* ```rest
* :math:`code`
* ```
*/
final class MathTextRole extends BaseTextRole
{
protected string $name = 'math';
Expand Down
11 changes: 0 additions & 11 deletions src/RestructuredText/TextRoles/SpanTextRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@
use phpDocumentor\Guides\Nodes\Inline\GenericTextRoleInlineNode;
use phpDocumentor\Guides\RestructuredText\Parser\DocumentParserContext;

/**
* This text role is extended by custom text roles that do not feature a base text role:
*
* ```
* .. role:: custom
* :class: special
*
* :custom:`interpreted text`
*
* ```
*/
final class SpanTextRole extends BaseTextRole
{
protected string $name = 'span';
Expand Down

0 comments on commit 4850cea

Please sign in to comment.