Open tony opened 2 years ago
Sounds like a good idea! Thx for the suggestion! I think it makes sense to use the MyST parser for extracting the doctests. Are you familiar with the MyST python api?
@thisch Not enough to champion a PR
The reference page should be a good place to start:
My ambition would be to use it here: https://libvcs.git-pull.com/parse/git.html (.md, .py)
Right now I have doctest everywhere as its amazingly efficient to have meaningful tests that double as documentation, but I'd like to have tutorials, how to, and explanations where the examples are backed by tests.
Workaround: If using automodule
directives, write the doctests at the top of the .py
file.
myst-parser (github) supports sphinx roles.
Quick links:
sphinx.ext.doctest
(source: sphinx/ext/doctest.py)nodes.literal_block
notnodes.doctest_block
(message)Normal directive syntax: