Description
Is your feature request related to a problem? Please describe.
I would like to use the docs build execution as a way to check that the code in the docs is staying up to date with the underlying python library. For this to work the docs build must fail when the code raises an exception. That is, a code block containing raise ValueError
should stop the docs build with a non-zero returncode.
Describe the solution you'd like
When a code block raises a value error unexpectedly (i.e. not indicated by the returncode
option) throw a PluginError
I think this would amount to (maybe optionally) adding a line to this block:
markdown-exec/src/markdown_exec/formatters/base.py
Lines 145 to 155 in 36db197
Describe alternatives you've considered
I don't think there is an alternative method for this plugin.
Additional context
I think this could be configurable, even opt in. And it should still be possible to have errors, in the same way the shell code works.
I'm happy to make a PR implementing this if that's helpful