-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: enable matplotlib and plotly in examples #567
base: main
Are you sure you want to change the base?
Conversation
Plotly and matplotlib are supported. Main issue here is that the different extensions are getting in conflict because "sphinx-gallery" generates a bunch of files. Still working on it. |
doc/source/conf.py
Outdated
|
||
|
||
def revert_gallery_patterns(app, builder): | ||
"""Revert the gallery excluded patterns.""" |
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.
Me might give more explanations here for this revert.
doc/source/conf.py
Outdated
def revert_gallery_patterns(app, builder): | ||
"""Revert the gallery excluded patterns.""" | ||
excluded_gallery_pattern = app.config.exclude_patterns | ||
excluded_gallery_pattern.remove("examples/gallery-examples/*.ipynb") |
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.
What if gallery-examples
do not exist?
Are we handling the ValueError
that will be raised later?
doc/source/conf.py
Outdated
# Remove the "Download all examples" button from the top level gallery | ||
"download_all_examples": False, | ||
# Modules for which function level galleries are created. In | ||
"image_scrapers": ("pyvista", "matplotlib"), | ||
"image_scrapers": ("pyvista", "matplotlib", plotly_sg_scraper), |
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.
Thanks for adding this one.
doc/source/conf.py
Outdated
def revert_exclude_patterns(app, env): | ||
"""Revert the exclude patterns.""" | ||
excluded_pattern = env.config.exclude_patterns | ||
excluded_pattern.remove("examples/gallery-examples/*.ipynb") | ||
env.config.exclude_patterns = excluded_pattern | ||
|
||
|
||
def setup(app: Sphinx) -> Dict: | ||
"""Sphinx hooks to add to the setup.""" | ||
app.connect("env-updated", revert_exclude_patterns) |
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.
Nice hack, @Revathyvenugopal162!
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.
Could we add some information about it. Whether it is a docstring or similar.
Co-authored-by: Maxime Rey <[email protected]>
Co-authored-by: Maxime Rey <[email protected]>
This pull-request fixes #301 by ensuring plotly is supported in our theme. Matplotlib support is explored too.