Skip to content

DOC: Prevent double entries in navigation panel of Using Matplotlib #26262

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
wants to merge 1 commit into from

Conversation

StefRe
Copy link
Contributor

@StefRe StefRe commented Jul 5, 2023

PR summary

Prevent double entries in navigation panel of Using Matplotlib.

closes #26261.

PR checklist

@StefRe
Copy link
Contributor Author

StefRe commented Jul 5, 2023

Renaming README.txt to index.rst solved the double entries issue but it also removed to sphinx gallery thumbnails. Do we need the thumbnails?

OLD:
grafik



NEW:
grafik

@tacaswell
Copy link
Member

I would prefer the thumbnails over the headings, but that is a mild preference. If getting that is hard this is 👍

@jklymak
Copy link
Member

jklymak commented Jul 5, 2023

Ha ha. OK, we are whack-a-moling sphinx/sphinx-gallery weirdness here.

#26141 added the manual TOC so that the cards in https://matplotlib.org/devdocs/users/explain/index.html would have subsections (see the Color card). If you remove the manual TOC, then the sphinx-gallery TOC is hidden and doesn't show up as a subsection. However, it appears that the left bar is somehow able to parse both the hidden and the visible TOC.

There seem to be a few ways to fix this

  1. make the cards ourselves, and don't let sphinx gallery make the index.rst (basically this PR).
  2. sphinx gallery optionally allows the TOC they generate to be visible instead of "hidden"
  3. pydata sphinx theme could respect "hidden" (however I expect they don't respect "hidden" because folks want sphinx gallery to work).
  4. Somehow make TOC entries for user/explain/index include hidden index.

@jklymak
Copy link
Member

jklymak commented Jul 5, 2023

Ah, 3 is probably the best bet

.. toctree::
   :includehidden:

So the todo here is 1) remove the manual TOC entries in #26141 and fix users/explain/index entries to have :include hidden:. @StefRe happy for you to do this, or I'm happy to do it.

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments for what I think is the right path here.

@StefRe
Copy link
Contributor Author

StefRe commented Jul 5, 2023

@jklymak I would be grateful if you could finish this. I tried several things but I admit didn't fully understand what I'm doing actually, so it would be great if you could make this work so maybe I can learn how things work here.
Maybe it's easier to close this PR and you make a new one - I'm happy with any solution.

@jklymak
Copy link
Member

jklymak commented Jul 5, 2023

Sure, if OK it'll be easier for me to just open a new PR. Thanks for noticing the issue!

@StefRe StefRe closed this Jul 5, 2023
@StefRe StefRe deleted the doc/users_navigation branch July 5, 2023 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Doc]: Double entries in navigation menu of Using Matplotlib
3 participants