Skip to content

Move version switcher next to the logo #23142

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

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented May 26, 2022

This is in preparation for adding the search field to the navbar (matplotlib/mpl-brochure-site#50). IMHO
placing the version next to the logo also rhymes better.

Styling of the switcher is more muted (not the strong blue). It's colors
are taken from the panels on the index page.

New:
grafik

Old:
grafik

@timhoffm timhoffm added the Documentation: website layout/behavior/styling changes label May 26, 2022
@timhoffm timhoffm added this to the v3.6.0 milestone May 26, 2022
@timhoffm
Copy link
Member Author

timhoffm commented May 26, 2022

https://output.circle-artifacts.com/output/job/fb1c34e8-73c4-4237-b610-fd4efb28348b/artifacts/0/doc/build/html/index.html

Still have to find out how to shorten the version number in the devdocs.
grafik

IMHO this should only 3.6.0.dev. If we need the full commit id, that should likely be in the footer.


Edit: the length should be fixed by #23145. Still waiting for that to propagate to https://matplotlib.org/devdocs/_static/switcher.json

@timhoffm timhoffm force-pushed the doc-version-switcher-position branch from 249cc32 to 6be0e66 Compare May 26, 2022 20:39
This is in preparation for adding the search field to the navbar. IMHO
placing the version next to the logo also rhymes better.

Styling of the switcher is more muted (not the strong blue). It's colors
are taken from the panels on the index page.
@timhoffm timhoffm force-pushed the doc-version-switcher-position branch from 6be0e66 to ef89431 Compare May 26, 2022 22:11
@jklymak
Copy link
Member

jklymak commented May 27, 2022

I am not a fan of it next to the logo - it's a pretty junky widget and I prefer the whitespace around the logo.

EDIT: under the logo is even worse - it makes the topbar thicker just to accommodate this one element.

@timhoffm
Copy link
Member Author

Under the logo is only because the devdocs full version is so long. In a release this should already be ok. As written, I still have to figure out how to shorten the version entry. It should look something like this then:

grafik

We could also reduce the style even more (and only display the box when hovering over it):

grafik

@oscargus
Copy link
Member

Although I like the idea of being able to switch version in the header, I do share the concerns of @jklymak . With styling I think it is a completely different thing though. Right now it just looks so big (partly because of the width, which as you say will not really be a problem except for CI builds, but also the height).

@timhoffm timhoffm force-pushed the doc-version-switcher-position branch from 5d20c44 to a18aa85 Compare May 29, 2022 20:55
@timhoffm
Copy link
Member Author

I think I have fixed the start value to show in the switcher.



/* styling for version switcher */
.navbar-brand {
Copy link
Member

Choose a reason for hiding this comment

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

I like this styling, but still opposed to moving next to the logo for aesthetic reasons.

@greglucas
Copy link
Contributor

I probably have a slight preference for it on the right-hand side as well, but can't say it makes a huge difference to me. Note that Pandas and Numpy have the version switcher on the right, but the Python docs have it on the left, so it is somewhat project dependent.

@timhoffm
Copy link
Member Author

timhoffm commented Jun 6, 2022

Note that the suggestion to move the version switcher next to the logo has gotten much appreciation with pydata-sphinx-theme pydata/pydata-sphinx-theme#680. And they are making it the default position pydata/pydata-sphinx-theme#698.

I haven't seen a version switcher in NumPy. But for pandas I suspect that they have just taken over the default from pydata-sphinx-theme (not least because they use the default color, which is a bit off for the general theme; and that may be a hint that they haven't yet taken the time for any customization/optimization).

@timhoffm
Copy link
Member Author

This got out of date. Since pydata-sphinx-theme has the version next to the logo by default. Implementation would now be simply to revert to the theme defaults. While I still think this would be better, I'm not going to follow up due to above opposition.

@timhoffm timhoffm closed this May 18, 2023
@timhoffm timhoffm deleted the doc-version-switcher-position branch July 19, 2024 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation: website layout/behavior/styling changes status: needs rebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants