Skip to content
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

DOC: add version dropdown to the online doc site #45370

Merged
merged 2 commits into from
Jan 18, 2022

Conversation

jorisvandenbossche
Copy link
Member

@jorisvandenbossche jorisvandenbossche commented Jan 14, 2022

xref #42722

This adds a version dropdown to our documentation site.

Currently, it is added on the right side of the top nav bar (for the rest using the default styling from the upstream sphinx theme):

Screenshot from 2022-01-14 17-28-30

(my mouse was hovering the "1.3.5 (stable") entry (not visible on the screenshot), which is why that entry has a different shade of grey)

An alternative location could be next to the logo (on the left side of the top nav bar)

The entries that are included are controlled by the versions.json file that is added.
We will need to update that file after a new release. But, that file is not included in the docs itself, but lives in the /web for the main website, and since that is directly served from the main branch, we can always easily update that (so the update doesn't strictly need to happen before cutting the release to have it included).

web/pandas/versions.json Outdated Show resolved Hide resolved
},
{
"name": "1.3.5 (stable)",
"version": "docs"
Copy link
Member

Choose a reason for hiding this comment

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

What's the difference between this (stable) and pandas-docs/version/1.3?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, not fully sure about this. So the difference is the exact url. The stable one links to https://pandas.pydata.org/docs/, while the other links to https://pandas.pydata.org/pandas-docs/version/1.3/.

Currently, that's both linking to the exact same docs (for 1.3.5). But once 1.4.0 is out, the https://pandas.pydata.org/docs/ will start pointing to the 1.4 docs.

So if we don't yet add this 1.3 specific entry, that means you can't (from this menu) get to a page / link that will always keep linking to the 1.3 docs.
Now, that's maybe not too important to be able to do, so we could also leave it out (and only add the version-specific entry once the next stable release is out)

Copy link
Member

Choose a reason for hiding this comment

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

Ah okay so it sounds like "latest released" vs a specific version.

I would be partial just to have links to specific versions and not necessarily https://pandas.pydata.org/docs/ but not a super strong opinion of mine.

Copy link
Member Author

Choose a reason for hiding this comment

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

IMO I would include a link to the stable (https://pandas.pydata.org/docs/) docs. That is (or should be) the most used documentation version, and so I think it is good to have an explicit link to that from the older versions.

Copy link
Member

Choose a reason for hiding this comment

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

Linking to the stable docs sounds good.

},
{
"name": "1.3.5",
"version": "pandas-docs/version/1.3"
Copy link
Member Author

Choose a reason for hiding this comment

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

Question: is there any preference in showing the fully qualified version ("1.3.5"), or rather a simplified one ("1.3") ?
Also referring to django (https://docs.djangoproject.com/), for example they show the simplified version

Copy link
Contributor

Choose a reason for hiding this comment

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

i would just show the minor version e.g. 1.3


switcher_version = version
if ".dev" in version:
switcher_version = version.split(".0.dev")[0] + " (dev)"
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this be a bit more generic?

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you clarify this question?
(this only needs to handle our own pd.__version__, and produce something that matches what we define in the versions.json, so it doesn't need to be generic)

},
{
"name": "1.3.5",
"version": "pandas-docs/version/1.3"
Copy link
Contributor

Choose a reason for hiding this comment

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

i would just show the minor version e.g. 1.3

@jorisvandenbossche
Copy link
Member Author

OK, I simplified it to show just the major.minor version, and to just use "dev" for the development version

@jreback
Copy link
Contributor

jreback commented Jan 18, 2022

@jreback
Copy link
Contributor

jreback commented Jan 18, 2022

ok let's give this a try.

@jreback jreback merged commit bc2a383 into pandas-dev:main Jan 18, 2022
@jreback
Copy link
Contributor

jreback commented Jan 18, 2022

@meeseeksdev backport 1.4.x

@lumberbot-app
Copy link

lumberbot-app bot commented Jan 18, 2022

Something went wrong ... Please have a look at my logs.

lithomas1 pushed a commit that referenced this pull request Jan 19, 2022
…45460)

Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
@jorisvandenbossche jorisvandenbossche deleted the version-dropdown branch January 19, 2022 06:54
@jorisvandenbossche
Copy link
Member Author

It's live -> https://pandas.pydata.org/docs/dev/

For now if you use the dropdown to go the another version, the dropdown disappears of course (only new releases will have the dropdown)

@jreback
Copy link
Contributor

jreback commented Jan 19, 2022

nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants