Skip to content

Commit

Permalink
[DOCS] Add admonition directive 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 2b1f9c6 commit 2344d8e
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/RestructuredText/Directives/AttentionDirective.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@

use phpDocumentor\Guides\RestructuredText\Parser\Productions\Rule;

/**
* Directive to create an attention admonition.
*
* Example:
*
* ```rest
* .. attention::
*
* This is an attention admonition.
* ```
*/
final class AttentionDirective extends AbstractAdmonitionDirective
{
public function __construct(protected Rule $startingRule)
Expand Down
11 changes: 11 additions & 0 deletions src/RestructuredText/Directives/CautionDirective.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@

use phpDocumentor\Guides\RestructuredText\Parser\Productions\Rule;

/**
* Directive to create a caution admonition.
*
* Example:
*
* ```rest
* .. caution::
*
* This is a caution admonition.
* ```
*/
final class CautionDirective extends AbstractAdmonitionDirective
{
public function __construct(protected Rule $startingRule)
Expand Down
13 changes: 12 additions & 1 deletion src/RestructuredText/Directives/DangerDirective.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@

use phpDocumentor\Guides\RestructuredText\Parser\Productions\Rule;

final class DangerDirective extends AbstractAdmonitionDirective
/**
* Directive to create a danger admonition.
*
* Example:
*
* ```rest
* .. danger::
*
* This is a danger admonition.
* ```
*/
class DangerDirective extends AbstractAdmonitionDirective
{
public function __construct(protected Rule $startingRule)
{
Expand Down
11 changes: 11 additions & 0 deletions src/RestructuredText/Directives/ErrorDirective.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@

use phpDocumentor\Guides\RestructuredText\Parser\Productions\Rule;

/**
* Directive to create a error admonition.
*
* Example:
*
* ```rest
* .. error::
*
* This is an error admonition.
* ```
*/
final class ErrorDirective extends AbstractAdmonitionDirective
{
public function __construct(protected Rule $startingRule)
Expand Down
11 changes: 11 additions & 0 deletions src/RestructuredText/Directives/HintDirective.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@

use phpDocumentor\Guides\RestructuredText\Parser\Productions\Rule;

/**
* Directive to create a hint admonition.
*
* Example:
*
* ```rest
* .. hint::
*
* This is a hint admonition.
* ```
*/
final class HintDirective extends AbstractAdmonitionDirective
{
public function __construct(protected Rule $startingRule)
Expand Down
11 changes: 11 additions & 0 deletions src/RestructuredText/Directives/ImportantDirective.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@

use phpDocumentor\Guides\RestructuredText\Parser\Productions\Rule;

/**
* Directive to create a important admonition.
*
* Example:
*
* ```rest
* .. important::
*
* This is a important admonition.
* ```
*/
final class ImportantDirective extends AbstractAdmonitionDirective
{
public function __construct(protected Rule $startingRule)
Expand Down
11 changes: 11 additions & 0 deletions src/RestructuredText/Directives/NoteDirective.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@

use phpDocumentor\Guides\RestructuredText\Parser\Productions\Rule;

/**
* Directive to create a note admonition.
*
* Example:
*
* ```rest
* .. note::
*
* This is a note admonition.
* ```
*/
final class NoteDirective extends AbstractAdmonitionDirective
{
public function __construct(protected Rule $startingRule)
Expand Down
11 changes: 11 additions & 0 deletions src/RestructuredText/Directives/SeeAlsoDirective.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@

use phpDocumentor\Guides\RestructuredText\Parser\Productions\Rule;

/**
* Directive to create a seealso admonition.
*
* Example:
*
* ```rest
* .. seealso::
*
* This is a seealso admonition.
* ```
*/
final class SeeAlsoDirective extends AbstractAdmonitionDirective
{
public function __construct(protected Rule $startingRule)
Expand Down
11 changes: 11 additions & 0 deletions src/RestructuredText/Directives/TipDirective.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@

use phpDocumentor\Guides\RestructuredText\Parser\Productions\Rule;

/**
* Directive to create a tip admonition.
*
* Example:
*
* ```rest
* .. tip::
*
* This is a tip admonition.
* ```
*/
final class TipDirective extends AbstractAdmonitionDirective
{
public function __construct(protected Rule $startingRule)
Expand Down
11 changes: 11 additions & 0 deletions src/RestructuredText/Directives/WarningDirective.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@

use phpDocumentor\Guides\RestructuredText\Parser\Productions\Rule;

/**
* Directive to create a warning admonition.
*
* Example:
*
* ```rest
* .. warning::
*
* This is a warning admonition.
* ```
*/
final class WarningDirective extends AbstractAdmonitionDirective
{
public function __construct(protected Rule $startingRule)
Expand Down

0 comments on commit 2344d8e

Please sign in to comment.