diff --git a/sphinxcontrib/jupyter/writers/translate_all.py b/sphinxcontrib/jupyter/writers/translate_all.py index 9cdf396b..4ab24d79 100644 --- a/sphinxcontrib/jupyter/writers/translate_all.py +++ b/sphinxcontrib/jupyter/writers/translate_all.py @@ -202,6 +202,9 @@ def visit_image(self, node): ### preventing image from the index file at the moment if self.in_book_index: return + ### Skip solutions if we say to + if "solution" in node.attributes['classes'] and self.jupyter_drop_solutions: + return uri = node.attributes["uri"] self.images.append(uri) #TODO: list of image files if self.jupyter_download_nb_image_urlpath: diff --git a/tests/base/solutions.rst b/tests/base/solutions.rst index c9a6ed44..8afca863 100644 --- a/tests/base/solutions.rst +++ b/tests/base/solutions.rst @@ -34,3 +34,6 @@ when :math:`x \in [0,1]` ax.fill(x, y, zorder=10) ax.grid(True, zorder=5) plt.show() + +.. image:: _static/hood.jpg + :class: solution