Usage¶
Mock directives¶
Consider we have an undefined foo directive in document:
Source
Here is a ``foo`` directive:
.. foo::
:opt1: val1
:opt2: val2
:flag1:
Result
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:
Source
Here is a ``bar`` directive:
.. bar::
:opt1: val1
:opt2: val2
:flag1:
Result
Here is a bar directive:
.. bar::
:opt1: val1
:opt2: val2
:flag1:
What happens if we don’t mock undefined directives?
Source
Here is a ``baz`` directive:
.. baz::
:opt1: val1
:opt2: val2
:flag1:
Result
Here is a baz directive: