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