Skip to content

Add :caption: for .. doctest:: #6915

@astromatt

Description

@astromatt

I wrote 1307 pages long book on Python (http://python.astrotech.io) using Sphinx and I love this tool. This is also not my first book using it.

Now the book is too long to check all 2767 "code-block" directives manually. I wanted to use sphinx.ext.doctest and CI process for this. The idea is super good, but doctest directive does not support neither caption, name nor emphasize-lines option. I can live without emphasizing, but I use caption all over the place to explain code.

https://github.com/sphinx-doc/sphinx/blob/master/sphinx/ext/doctest.py#L165
https://github.com/sphinx-doc/sphinx/blob/master/sphinx/directives/code.py#L177
https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html#directives

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions