-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Migration to sphinx-gallery #8247
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
b918016
DOC starting the migration to sphinx
NelleV b110b1f
DOC Set up sphinx-gallery in parallel of our own gallery
NelleV ba6d268
DOC added sphinx-gallery as a requirement
NelleV c908f98
DOC Added readme files to include examples in SG
NelleV c61c856
DOC SG doesn't support parallel builds yet
NelleV eaaf182
DOC lines, bars and markers is now full SG
NelleV 4f92501
DOC examples/statistics is fully SG
NelleV 40eab47
DOC pie and polar charts is now full SG
NelleV 9738124
DOC subplots, axes and figures are now full SG
NelleV 8f8d316
DOC added ticks and spines to sphinx-gallery
NelleV 55a5840
DOC image, contours and fields are fully SG compatible
NelleV 9bf91a8
DOC showcase are fully SG compatible
NelleV f50ab00
DOC text, labels and annotations are fully SG compatible
NelleV 7c79b12
DOC tick and spines is now full SG compatible
NelleV 1ed25aa
DOC shapes and collections is now fully SG compatible
NelleV 8bc4597
DOC mplot3d is fully SG-compatible
NelleV d5583f8
DOC The gallery is now built with sphinx-gallery
NelleV 8f5f185
DOC all plots in the gallery now produce images
NelleV 9d805a1
DOC API is now fully SG-compatible
NelleV 4a13444
DOC linking to auto_examples when possible
NelleV 8b764e7
DOC FIX nitpicks in the conf file
NelleV File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
DOC Set up sphinx-gallery in parallel of our own gallery
- Loading branch information
commit b110b1f715e0930e18c1e7d84ff5a03f8f4b97dc
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,7 @@ | |
| 'sphinx.ext.inheritance_diagram', | ||
| 'sphinx_gallery.gen_gallery', | ||
| 'sphinxext.gen_rst', | ||
| 'sphinxext.gen_gallery', | ||
| 'matplotlib.sphinxext.plot_directive', | ||
| 'sphinxext.github', | ||
| 'numpydoc'] | ||
|
|
@@ -105,6 +106,7 @@ | |
| # path where to save gallery generated examples | ||
| 'gallery_dirs' : 'auto_examples'} | ||
|
|
||
| plot_gallery = True | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Blank line after. |
||
| # Add any paths that contain templates here, relative to this directory. | ||
| templates_path = ['_templates'] | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| .. _color_examples: | ||
|
|
||
| Color | ||
| ===== |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| .. _lines_bars_and_markers_example: | ||
|
|
||
| Lines, bars and markers | ||
| ======================= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| .. _pie_and_polar_charts: | ||
|
|
||
| Pie and polar charts | ||
| ==================== |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can we not put it in
galleryinstead? Or if it werempl_examples, then some of the lines that were changed would not have been necessary.Whatever it becomes, I don't like the
auto_prefix; it's an internal concern and doesn't really make any sense to present that in the URL to a user from a semantic point of view.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.
It's the default and is a convention followed by many (if not all) the projects. I'd rather stick with it for consistency.
We can't rename this to mpl_examples as mpl_examples still exists.
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.
I'm not sure those are compelling reasons. I went back through the blame 7 years and couldn't find any reasoning behind it (that's not to say that there wasn't one.) My reasoning here is that URLs should be discoverable, simple, and at least try to give some semantic meaning.
A user might go to
matplotlib.org/galleryormatplotlib.org/examplesdirectly (yes, there's Google, but let's assume they're not using it for some reason), but there's a 99% chance that no-one will spontaneously go tomatplotlib.org/auto_examples.And what does the "auto_" prefix mean? It means that the rst was automatically generated from the example Python code. This is a meaningless distinction to a user. When they see "auto", they see "automatically generated" aka "not hand-written" aka "not very good". I'm not going to claim that all of our examples are 100% clear, but they've all been hand-written in some fashion, and some of them are even quite amazing.
In fact, for that same reasoning, I've just talked myself into retracting the "mpl_examples" suggestion, since the "mpl_" prefix is redundant and meaningless in this context. Also, our existing site uses
matplotlib.org/examples/andmatplotlib.org/gallery.html; I don't think we should break that.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.
For the time being, the folder cannot be neither "examples" nor "mpl_examples", and this will not change in the foreseeable future considering the state of our examples (unless we remove all examples that are not SG compatible).
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.
It's not possible to rename the current examples/mpl_examples to make room for the gallery-based examples? I strongly dislike the
auto_examplesname as well--I've overridden that name for sphinx-gallery in my own projects.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.
Will this end up exposed in the URL?
If so, I think we should pick something either a) shorter (ex
sgorae) or b) something more meaningful.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.
I does show up in the URL, for example this is our gallery at MNE-python. It does have auto-examples in the page, though that's sorta become the convention with sphinx-gallery (same goes for scikit-learn: http://scikit-learn.org/stable/auto_examples/index.html).
I seem to remember conversations with folks that this was a non-trivial thing to change but I could be wrong...it's been working out well enough for us. If you want you could use an
.rstfile that contains the gallery itself, then the objects that the gallery links to would be in theauto_examplesfolder.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.
Nope, it's completely trivial to change: https://unidata.github.io/MetPy/examples/index.html
I'm going to argue one more time NOT to use
auto_examples. Whether they're generated automatically or not is immaterial to the user, so we should NOT be bleeding that implementation detail of our documentation build procedure to the outside world.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.
It's not that trivial, because matplotlib somehow does I don't know what in the plot directive that makes this a pain in the butt to change. Which is why I asked for feedback a month ago.
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.
FWIW I'll give this a shot to change the name to
examples_gallery. It doesn't look completely trivial in the sense that there are links hard-coded all over the codebase. There are also some weird errors happening inside the plot directive that I can try to debug. I'll open a separate PR then if I can figure it out.