Skip to content

Commit 9cfc2a5

Browse files
jaapiolinawolf
authored andcommitted
[DOCS] Add admonition directive docs
1 parent 7ec1588 commit 9cfc2a5

File tree

11 files changed

+116
-80
lines changed

11 files changed

+116
-80
lines changed

docs/reference/restructuredtext/admonitions.rst

Lines changed: 5 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -4,90 +4,16 @@
44
Admonitions
55
===========
66

7-
The following directives are called "admonitions".
8-
You can use them to point out additional or important information.
7+
Admonitions are blocks of text that are rendered in a special way to draw attention to them. They are often used to
8+
provide additional information to the reader about the content that is being discussed.
99

1010
Examples
1111
========
1212

13+
.. index:: reST directives; seealso
14+
1315
.. phpdoc:class-list:: [?(@.inheritedElement == "\phpDocumentor\Guides\RestructuredText\Directives\AbstractAdmonitionDirective")]
1416
1517
.. phpdoc:name::
1618
.. phpdoc:summary::
17-
18-
19-
20-
21-
.. index:: reST directives; seealso
22-
23-
See also
24-
--------
25-
26-
.. code-block:: rest
27-
28-
.. seealso::
29-
`Admonitions <http://docutils.sourceforge.net/0.7/docs/ref/rst/directives.html#admonitions>`__
30-
31-
.. seealso::
32-
`Admonitions <http://docutils.sourceforge.net/0.7/docs/ref/rst/directives.html#admonitions>`__
33-
34-
35-
.. index:: reST directives; note
36-
37-
Note
38-
----
39-
40-
.. code-block:: rest
41-
42-
.. note::
43-
A note
44-
45-
.. note::
46-
A note
47-
48-
49-
.. index:: reST directives; tip
50-
51-
Tip
52-
---
53-
54-
.. code-block:: rest
55-
56-
.. tip::
57-
A tip
58-
59-
.. tip::
60-
A tip
61-
62-
You may also use the admonition **hint**, but this is very similar
63-
and **tip** is more commonly used in the documentation.
64-
65-
.. index:: reST directives; warning
66-
67-
Warning
68-
-------
69-
70-
.. code-block:: rest
71-
72-
.. warning::
73-
Some text pointing out something that people should be warned about.
74-
75-
.. warning::
76-
Some text pointing out something that people should be warned about.
77-
78-
You may also use the admonitions **caution** or even **danger** if the
79-
severity of the warning must be stressed.
80-
81-
82-
.. index:: reST directives; attention
83-
84-
Attention
85-
---------
86-
87-
.. code-block:: rest
88-
89-
.. attention::
90-
A attention
91-
92-
.. attention::
93-
A attention
19+
.. phpdoc:description::

packages/guides-restructured-text/src/RestructuredText/Directives/AttentionDirective.php

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

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

18+
/**
19+
* Directive to create an attention admonition.
20+
*
21+
* Example:
22+
*
23+
* ```rest
24+
* .. attention::
25+
*
26+
* This is an attention admonition.
27+
* ```
28+
*/
1829
final class AttentionDirective extends AbstractAdmonitionDirective
1930
{
2031
public function __construct(protected Rule $startingRule)

packages/guides-restructured-text/src/RestructuredText/Directives/CautionDirective.php

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

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

18+
/**
19+
* Directive to create a caution admonition.
20+
*
21+
* Example:
22+
*
23+
* ```rest
24+
* .. caution::
25+
*
26+
* This is a caution admonition.
27+
* ```
28+
*/
1829
final class CautionDirective extends AbstractAdmonitionDirective
1930
{
2031
public function __construct(protected Rule $startingRule)

packages/guides-restructured-text/src/RestructuredText/Directives/DangerDirective.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,18 @@
1515

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

18-
final class DangerDirective extends AbstractAdmonitionDirective
18+
/**
19+
* Directive to create a danger admonition.
20+
*
21+
* Example:
22+
*
23+
* ```rest
24+
* .. danger::
25+
*
26+
* This is a danger admonition.
27+
* ```
28+
*/
29+
class DangerDirective extends AbstractAdmonitionDirective
1930
{
2031
public function __construct(protected Rule $startingRule)
2132
{

packages/guides-restructured-text/src/RestructuredText/Directives/ErrorDirective.php

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

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

18+
/**
19+
* Directive to create a error admonition.
20+
*
21+
* Example:
22+
*
23+
* ```rest
24+
* .. error::
25+
*
26+
* This is an error admonition.
27+
* ```
28+
*/
1829
final class ErrorDirective extends AbstractAdmonitionDirective
1930
{
2031
public function __construct(protected Rule $startingRule)

packages/guides-restructured-text/src/RestructuredText/Directives/HintDirective.php

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

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

18+
/**
19+
* Directive to create a hint admonition.
20+
*
21+
* Example:
22+
*
23+
* ```rest
24+
* .. hint::
25+
*
26+
* This is a hint admonition.
27+
* ```
28+
*/
1829
final class HintDirective extends AbstractAdmonitionDirective
1930
{
2031
public function __construct(protected Rule $startingRule)

packages/guides-restructured-text/src/RestructuredText/Directives/ImportantDirective.php

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

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

18+
/**
19+
* Directive to create a important admonition.
20+
*
21+
* Example:
22+
*
23+
* ```rest
24+
* .. important::
25+
*
26+
* This is a important admonition.
27+
* ```
28+
*/
1829
final class ImportantDirective extends AbstractAdmonitionDirective
1930
{
2031
public function __construct(protected Rule $startingRule)

packages/guides-restructured-text/src/RestructuredText/Directives/NoteDirective.php

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

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

18+
/**
19+
* Directive to create a note admonition.
20+
*
21+
* Example:
22+
*
23+
* ```rest
24+
* .. note::
25+
*
26+
* This is a note admonition.
27+
* ```
28+
*/
1829
final class NoteDirective extends AbstractAdmonitionDirective
1930
{
2031
public function __construct(protected Rule $startingRule)

packages/guides-restructured-text/src/RestructuredText/Directives/SeeAlsoDirective.php

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

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

18+
/**
19+
* Directive to create a seealso admonition.
20+
*
21+
* Example:
22+
*
23+
* ```rest
24+
* .. seealso::
25+
*
26+
* This is a seealso admonition.
27+
* ```
28+
*/
1829
final class SeeAlsoDirective extends AbstractAdmonitionDirective
1930
{
2031
public function __construct(protected Rule $startingRule)

packages/guides-restructured-text/src/RestructuredText/Directives/TipDirective.php

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

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

18+
/**
19+
* Directive to create a tip admonition.
20+
*
21+
* Example:
22+
*
23+
* ```rest
24+
* .. tip::
25+
*
26+
* This is a tip admonition.
27+
* ```
28+
*/
1829
final class TipDirective extends AbstractAdmonitionDirective
1930
{
2031
public function __construct(protected Rule $startingRule)

0 commit comments

Comments
 (0)