PSphinxTheme.ext.psphinx_admonitions

Overview

all official P-SphinxTheme admonitions

This Sphinx extension is a collection of all official P-SphinxTheme admonitions

For example, the following snippet specifies a simple python-example admonition:

.. python-example:: Simple Example

   .. code-block:: python3

      for key in mydict:
         print(key)

depending on other options it renders to:

Python-Example

Simple Example

for key in mydict:
   print(key)

The next example has at the left side a hide show prompt toggle:

if a *code-block* starts with ``>>>`` there is an extra option on the left side to hide it

.. python-example:: Simple Example

   .. code-block:: python3

      >>> mylist = ['red', 'blue', 'green']
      >>> print(mylist[2])
      green
      >>>

it renders to:

Python-Example

Simple Example

>>> mylist = ['red', 'blue', 'green']
>>> print(mylist[2])
green
>>>

Directive Admonition Options

Adds / overwrites following options:

Replaces some docutils Admonitions

.. note::

.. tip::

.. note::

.. important::

.. warning::

Replaces some sphinx Admonitions

.. seealso::

Adds additional Admonitions

.. optional::

.. example::

.. python-example::
required highlighter: .. code-block:: python3
.. shell-example::
required highlighter: .. code-block:: sh
.. javascript-example::
required highlighter: .. code-block:: javascript
.. json-example::
required highlighter: .. code-block:: json
.. lconf-example::
required highlighter: .. code-block:: lconf