-
Notifications
You must be signed in to change notification settings - Fork 794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add strict option to sphinx extension #2551
Conversation
altair/sphinxext/altairplot.py
Outdated
) | ||
raise nodes.SkipNode | ||
if node["strict"]: | ||
raise ValueError(message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps raise ValueError(message) from e
to allow the error to include more context.
Looks good - I wonder if it would be worth adding a |
I'm not 100% sure what you mean, but I gave it a shot anyways: in eaf69c1 I imitated what's currently being done to the |
Yeah, I forgot that there's no gallery directive. That looks good. Last thing: since there are no unit tests to exercise this option, have you tried it locally to confirm it works as expected? |
Yes! With
I get
and with
|
Very nice - thanks! |
Closes #2550
This adds a
:strict:
option to the altair sphinx extension. When set, it ensures that the documentation build fails when a code snippet can't be run. This is meant to prevent code snippets in the documentation from going stale. It is less restrictive than building the documentation with-W
because warnings for other reasons won't cause the build of the documentation to fail.