Skip to content

Commit 8d5404e

Browse files
committed
Document simplified doctest usage (#186)
1 parent 59241f3 commit 8d5404e

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

docs/src/examples.rst

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -215,21 +215,13 @@ Please specify a ``type`` in :rst:dir:`autolink-examples`:
215215
216216
Doctest code blocks
217217
-------------------
218-
Using the ``sphinx.ext.doctest`` extension for code examples requires
219-
setting up :confval:`codeautolink_custom_blocks`.
220-
To help in that, :func:`clean_pycon <sphinx_codeautolink.clean_pycon>`
221-
is provided as a ready-made transformer.
222-
223-
.. code:: python
218+
Using the ``sphinx.ext.doctest`` extension for code examples only requires
219+
activating the extension::
224220

225221
extensions = [
226222
...,
227223
"sphinx.ext.doctest",
228224
]
229-
codeautolink_custom_blocks = {
230-
"python3": None,
231-
"pycon3": "sphinx_codeautolink.clean_pycon",
232-
}
233225

234226
``doctest`` and ``testcode`` blocks now work as expected.
235227
However, any test setup and teardown code is not taken into account.

tests/extension/ref/lexer_extdoctest_doctest.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ attr
44
test_project.Foo
55
test_project.Foo
66
# split
7-
from sphinx_codeautolink.extension.block import clean_pycon
87
extensions.append("sphinx.ext.doctest")
9-
codeautolink_custom_blocks = {"pycon3": clean_pycon}
10-
suppress_warnings = ["config.cache"]
118
# split
129
Test project
1310
============

tests/extension/ref/lexer_extdoctest_testcode.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ test_project.Foo
55
test_project.Foo
66
# split
77
extensions.append("sphinx.ext.doctest")
8-
codeautolink_custom_blocks = {"python3": None}
98
# split
109
Test project
1110
============

0 commit comments

Comments
 (0)