Usage#

Mock directives#

Consider we have an undefined foo directive in document:

Here is a ``foo`` directive:

.. foo::
   :opt1: val1
   :opt2: val2
   :flag1:

It will be rendered as:

Example

Here is a foo directive:

The directive can’t be seen because it is mocked in conf.py:

mock_directives = [
    'contents',
    'foo',
    ('bar', 'literal'),
]

Mock Mode#

You can see directive bar is mocked too, but in literal mode.

mock_directives = [
    'contents',
    'foo',
    ('bar', 'literal'),
]

Consider we also have bar directive in document:

Here is a ``bar`` directive:

.. bar::
   :opt1: val1
   :opt2: val2
   :flag1:

It will be rendered as:

Example

Here is a bar directive:

.. bar::
   :opt1: val1
   :opt2: val2
   :flag1:

What happens if we don’t mock undefined directives?

Here is a ``baz`` directive:

.. baz::
   :opt1: val1
   :opt2: val2
   :flag1:

It will be rendered as:

Example

Here is a baz directive: