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: Update pydata-sphinx-theme to 0.14 #55885

Merged
merged 9 commits into from
Dec 22, 2023

Conversation

mroeschke
Copy link
Member

Screen Shot 2023-11-08 at 2 08 28 PM

Also uses a code block for an numpy operation that will change/fail with a newer version of numpy

@jorisvandenbossche
Copy link
Member

I think you need to update switcher_version in conf.py to ensure it matches the version entries in versions.json file, to ensure the dropdown shows the correct version on the button.
(from a quick look by downloading the artifact, that's not perfect because not everything works that way)

@@ -59,7 +59,7 @@ gitdb
google-auth
natsort
numpydoc
pydata-sphinx-theme==0.13
pydata-sphinx-theme>=0.14
Copy link
Member

Choose a reason for hiding this comment

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

I would personally prefer to bump the pin, and not unpin. For dependencies like this where appearance might change, I think it is good to keep a pinned version (and our deployed docs are more like an application), and consciously update the pin from time to time, checking that everything is still working as expected.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good point. Given how often this theme changes and APIs change it's better to pin

@mroeschke
Copy link
Member Author

I think you need to update switcher_version in conf.py to ensure it matches the version entries in versions.json file, to ensure the dropdown shows the correct version on the button. (from a quick look by downloading the artifact, that's not perfect because not everything works that way)

Hmm I'm not familiar with how the version switcher works (or if it's supposed to work locally) so could you explain the specific issue?

@jorisvandenbossche
Copy link
Member

Going to keep this for the next release (I still have to test it locally a bit more for the switcher version), so broke off the numpy code block change to #55911

@jorisvandenbossche jorisvandenbossche changed the title DEPS: Unpin pydata-sphinx-theme DOC: Update pydata-sphinx-theme to 0.14 Nov 10, 2023
@jorisvandenbossche
Copy link
Member

Hmm I'm not familiar with how the version switcher works (or if it's supposed to work locally) so could you explain the specific issue?

It's difficult to test locally (you need a released version to see it in practice), but so I pushed a commit that I think will make it work, based on my knowledge of fixing it for arrow.
Essentially, for the latest theme version, for the dropdown button to know which version of the docs you are currently viewing, it matches the "version" key in the json file with the "version_match" variable set in conf.py. And our json file uses short version numbers like "2.0" and "2.1" etc, so we need to update the variable we set as the current version of the built docs to something that matches that.

"navbar_end": ["version-switcher", "theme-switcher", "navbar-icon-links"],
"sidebar_includehidden": False,
Copy link
Member

Choose a reason for hiding this comment

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

Did you add this for a specific reason? (locally I am not directly seeing a difference)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah I thought this was needed before because the empty sidebar misaligned the body of the page, but looks like this isn't needed anymore

@jorisvandenbossche
Copy link
Member

The light/dark theme switcher also seems to be missing

@jorisvandenbossche jorisvandenbossche modified the milestones: 2.1.3, 2.1.4 Nov 13, 2023
@lithomas1 lithomas1 modified the milestones: 2.1.4, 2.2 Nov 14, 2023
@mroeschke
Copy link
Member Author

The light/dark theme switcher also seems to be missing

So looks like the light/dark theme switcher is still in the html

        <div class="navbar-item">

<script>
document.write(`
  <button class="btn btn-sm navbar-btn theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <span class="theme-switch nav-link" data-mode="light"><i class="fa-solid fa-sun fa-lg"></i></span>
    <span class="theme-switch nav-link" data-mode="dark"><i class="fa-solid fa-moon fa-lg"></i></span>
    <span class="theme-switch nav-link" data-mode="auto"><i class="fa-solid fa-circle-half-stroke fa-lg"></i></span>
  </button>
`);
</script></div>

Locally I had to comment out the html_theme_options["switcher"] for it to render correctly, so I'm not sure why it is interferring with the light/dark switcher

@lithomas1
Copy link
Member

/preview

Copy link
Contributor

No preview found for PR #55885. Did the docs build complete?

@jorisvandenbossche
Copy link
Member

The preview seems to have worked: http://pandas.pydata.org/preview/55885/docs/

@jorisvandenbossche
Copy link
Member

I see a few glitches I would report upstream, but I suppose this is good enough to merge for the RC. We still have some time to fixup a few things before the final release

Copy link
Member

@lithomas1 lithomas1 left a comment

Choose a reason for hiding this comment

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

Thanks @mroeschke

@lithomas1 lithomas1 merged commit 9b49a0a into pandas-dev:main Dec 22, 2023
45 checks passed
@mroeschke mroeschke deleted the docs/pst/unpin branch December 23, 2023 00:52
cbpygit pushed a commit to cbpygit/pandas that referenced this pull request Jan 2, 2024
* DEPS: Unpin pydata-sphinx-theme

* Pin to 0.14

* update switcher_version

* Add preferred version

---------

Co-authored-by: Joris Van den Bossche <[email protected]>
Co-authored-by: Thomas Li <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependencies Required and optional dependencies Docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOCS: Unpin pydata-sphinx-theme
3 participants