Closed sirosen closed 1 month ago
Yeah, it would be good to avoid this. I think it would be better to silently ignore the broken syntax. Your actual docs-building tool, or an rST linter, are better suited for detecting and reporting on such errors.
Would you like to work on a PR?
Would you like to work on a PR?
Yes, I'd love to!
I'm not able to today, but maybe tomorrow or later this week
Python Version
3.11.9
Package Version
1.18.0
Description
While refactoring some docs, I accidentally separated a
.. code-block:: python
directive from the relevant indented code block. So my docs had the form:The failure mode I got was a crash, which is, IMO, the correct result but the nature of the crash was not informative. Trace (invoked via pre-commit):
I think that when there is no match for a code block, it would be nice to bomb out with an explicit
ValueError
which contains the filename in the message. e.g.,ValueError: docs/foo.rst has a code-block with no content