warning is one of reStructuredText’s specific admonitions. They are all visually bold blocks often rendered in colors according to their type. Readers will appreciate if you spice up your text with admonitions like this for extra information or to raise their attention.
Content on the same line¶
Short text can be typed right after
warning:: (note the space after
1.. warning:: I'm warning
Content bellow the directive¶
For longer text more fits to put it the line bellow.
1.. warning:: 2 I'm warning
Content bellow the directive with blank line¶
Optionally, you can place a blank line before the text itself.
1.. warning:: 2 3 I'm warning
Directive name in uppercase¶
Directive name is case insensitive (like all directive and role names). Most documentation and book authors prefer typing directives and roles all in lowercase. However, writing directive name in uppercase corresponds with their “raise attention” objective and improves reStructuredText code readability.
1.. WARNING:: However writing admonitions uppercase can be considered as reasonable exception to "all-lowercase" rule.
However writing admonitions uppercase can be considered as reasonable exception to “all-lowercase” rule.
Any reStructuredText elements can be in admonition content. As always, you need only to keep correct indentation.
1.. warning:: 2 3 This is the admonition with complex body containing 4 5 - two items 6 - bullet list 7 8 And, code example:: 9 10 $ nano ~/.bash_aliases
This is the admonition with complex body containing
And, code example:
$ nano ~/.bash_aliases