-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Doc][Examples Gallery]: Side Navigation Section breaks on Animation … #25908
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
Conversation
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.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a while, please feel free to ping @matplotlib/developers
or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join us on gitter for real-time discussion.
For details on testing, writing docs, and our review process, please see the developer guide
We strive to be a welcoming and open project. Please follow our Code of Conduct.
Hi @Mubin17 Thank you for looking into this and welcome to the community. This is a good starting point, but we need the navigation section to appear like it does here: We would like to show the Examples links, as opposed to the API links ( that reference the matplotlib.* library ). To understand this better, click on pyplot animation from the navigation section and then see what the navigation section continues to display. It should be the same as the above screenshot. Whereas, if you were to click on some other example from the navigation section like Decay, it will load all the matplotlib api links in the navigation section, as opposed to retaining the examples links like it does in the pyplot animation as shown in your screenshot. This is what we want to fix. |
Thank you @codingtosh for reviewing my PR. I believe that the problem lies with the examples mentioned/referenced in the animation_api.rst file. They seem to be causing the website to break, while the examples not referenced their work just fine. Here is a list of examples referenced in the animation_api.rst:
![]() ![]() And here is the list of examples not referenced in animation_api.rst
Based on this observation, it appears that the examples mentioned in animation_api.rst are the root cause of the problem. The solution that I am proposing involves removing the examples from the animation_api.rst file entirely. By doing so, we can effectively break the linkage between the Example links and API links, which should resolve the issue with the side navigation. Additionally, this solution has the advantage of providing cleaner side navigation for the API references, as shown in the following example: https://user-images.githubusercontent.com/48038715/239146952-a8db6b1d-605a-4bbc-9ae0-f52ef564da45.png If there's a specific need to reference Example links in animation_api.rst, we can brainstorm some alternative approaches to achieve that while keeping the navigation section intact. I'm open to discussion. |
Hello @Mubin17 - thanks for looking into this! I think my preference would be to remove the toctree but keep simple links to the examples. I'll show what I mean below: |
@@ -165,33 +165,9 @@ function:: | |||
A third method is to use closures to build up the required | |||
artists and functions. A fourth method is to create a class. | |||
|
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.
Examples | |
~~~~~~~~ | |
* :doc:`../gallery/animation/animate_decay` | |
* :doc:`../gallery/animation/bayes_update` | |
* :doc:`../gallery/animation/double_pendulum` | |
* :doc:`../gallery/animation/animated_histogram` | |
* :doc:`../gallery/animation/rain` | |
* :doc:`../gallery/animation/random_walk` | |
* :doc:`../gallery/animation/simple_anim` | |
* :doc:`../gallery/animation/strip_chart` | |
* :doc:`../gallery/animation/unchained` |
../gallery/animation/simple_anim | ||
../gallery/animation/strip_chart | ||
../gallery/animation/unchained | ||
|
||
``ArtistAnimation`` | ||
------------------- | ||
|
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.
Same thing here:
Examples | |
~~~~~~~~ | |
* :doc:`../gallery/animation/dynamic_image` | |
@@ -270,14 +246,6 @@ strongly encouraged to use the `~.AbstractMovieWriter.saving` context manager:: | |||
|
|||
to ensure that setup and cleanup are performed as necessary. | |||
|
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.
And here:
Examples | |
-------- | |
* :doc:`../gallery/animation/frame_grabbing_sgskip` | |
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.
Looks great to me now, thanks @Mubin17 !
Thanks for the help @melissawm. I've squashed all the commits into one for the sake of clean-up. Let me know if there are any additional changes you would like me to address. Thanks again! |
There should have been an automatic check of the doc build and a link that allows us to view how the docs look with this change. I don’t know why that didn’t happen, but I’ll try closing and re-opening to see if that triggers it… |
Maybe because it's on |
@QuLogic I usually create a new branch for my pull requests, but it seems like I forgot to do it this time. My bad! Would creating a new PR on a separate branch help? |
It may help; I don't see anything obvious that would have been stopping it though. |
I have made a new PR [#25977] on a separate branch. I hope it helps |
OK, we'll see there. |
We deliberately skip tests if all the changes are under |
PR summary
This pull request is to address Issue #25836
The current behavior of the Animation Examples Gallery in the documentation is causing an inconsistent navigation experience. When clicking on any of the animation examples, the side navigation section displays links to the matplotlib API reference instead of the examples gallery. This PR removes the API reference links in the animation_api.rst which should fix Issue #25836.
This is what the side navigation looks like at the moment:

This is what it should look like:

@ksunden @codingtosh
PR checklist