Skip to content

DOC: Bump pydata-sphinx-theme version #26125

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

Merged
merged 7 commits into from
Apr 17, 2024

Conversation

hugovk
Copy link
Contributor

@hugovk hugovk commented Mar 24, 2024

Fixes #26058.

Fixes inaccessible contrast for a:visited links in admonitions.

Note: I didn't manage to build everything locally to test this out, does the CI generate a preview build?

Fixes inaccessible contrast for a:visited links in admonitions. Fixes numpy#26058.
@mattip
Copy link
Member

mattip commented Mar 24, 2024

I think these warnings are failing the build

WARNING: the pydata_sphinx_theme extension is not safe for parallel writing
WARNING: doing serial write

Perhaps the -j will have to be removed to get a docs build

SPHINXOPTS="-j2 -n" make -e html

Caused by: WARNING: the pydata_sphinx_theme extension is not safe for parallel writing
@hugovk
Copy link
Contributor Author

hugovk commented Mar 24, 2024

Thanks, updated!

@mattip
Copy link
Member

mattip commented Mar 25, 2024

here is an example API page. Generally it seems quite nice. I find the orange of the "See also" header a bit jarring. Do we need to remove some of our CSS styling?

@hugovk
Copy link
Contributor Author

hugovk commented Mar 25, 2024

Yes, that contrast needs fixing:

image image

If we disable the :before CSS from that file:

.admonition-legacy.admonition>.admonition-title::before,
div.admonition>.admonition-title::before {
  color: var(--pst-color-warning);
  content: var(--pst-icon-admonition-attention);
  background-color: var(--pst-color-warning);
}

We get:

image image

This CSS was added by @melissawm in #24939.

Melissa: is right thing to do, is delete div.admonition>.admonition-title::before and div.admonition>.admonition-title::after from that CSS and keep the .admonition-legacy bits?

@melissawm
Copy link
Member

That sounds about right, can you give it a try? Thanks for the ping!

@melissawm
Copy link
Member

@hugovk it looks like there's a bit of extra customization that is still causing some misalignment of items and truncation (see for example the top navbar and cards at the landing page: https://output.circle-artifacts.com/output/job/e09e4603-3ea6-4dc9-be1a-42c27782dbcd/artifacts/0/doc/build/html/index.html?pr=26125)

I'm not sure if that's from existing NumPy customization or from new PyData theme settings.

@hugovk
Copy link
Contributor Author

hugovk commented Mar 28, 2024

Hmm, not sure where to look for that. I did notice the some of the header elements have col-lg-3 and col-lg-9 classes, which are not used for https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html, removing those helps a bit, but I don't think that's the root issue.

https://numpy.org/doc/stable/ has a search box in the left column, not in the header like the PR preview, and the version selector is wider ("Choose version" vs. "1.26"). Deleting the col-lg- classes and search box makes the header "fit" like before...

Looks like this is a bigger job than just bumping a version and deleting some old CSS :) It might be better for someone else to continue this PR.

@melissawm
Copy link
Member

I can do that - thanks for getting it started! We can keep this one open and I'll push to it so you are still a co-author. Does that work for you? Thanks ❤️

@hugovk
Copy link
Contributor Author

hugovk commented Mar 29, 2024

Certainly! I'm not worried about co-author, feel free to push to this, close and create a new one, use or ditch my commits, or whatever is best for you. Thank you!

@melissawm
Copy link
Member

melissawm commented Apr 16, 2024

Hi folks - just updated this, and included some cleanup for the CSS file. If this is too much I'll understand and break it into another PR, but I figure since I needed to touch the CSS file anyway...

Here's a summary of the major changes:

Similar to scipy/scipy#20460, I'm using as much of the PyData Sphinx Theme predefined colors as possible. This means some of the NumPy colors are absent from this version. Again, if that's too aggressive I'm happy to walk those back.

Related: #25927

I will add links to the preview of the pages mentioned above as soon as CI finishes building.

This helps adjust the flow of the navbar items.

[skip azp][skip cirrus]
@mattip
Copy link
Member

mattip commented Apr 17, 2024

Commit eb4c33d removed an unrelated file, was that on purpose?

@mattip
Copy link
Member

mattip commented Apr 17, 2024

Looks much better. The version switcher is bright red on my browser. Is that the desired color?

@melissawm
Copy link
Member

@mattip the version switcher is red when it displays "choose version". It should be orange on devdocs and red on older versions. On stable it has the regular background color. This is the same approach I took for scipy, but maybe the red is too much?

@mattip
Copy link
Member

mattip commented Apr 17, 2024

This is the same approach I took for scipy

Then it should be fine. Let's get this in, we can always do more later.

@mattip mattip merged commit 3672ba6 into numpy:main Apr 17, 2024
@mattip
Copy link
Member

mattip commented Apr 17, 2024

Thanks @hugovk, @melissawm

@hugovk hugovk deleted the bump-pydata-sphinx-theme branch April 17, 2024 06:05
@hugovk
Copy link
Contributor Author

hugovk commented Apr 17, 2024

Thank you @melissawm!

@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Apr 17, 2024
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Apr 18, 2024
@bmwoodruff
Copy link
Member

bmwoodruff commented May 15, 2024

Figured I'd add what I found to the conversation. I've been building numpy on codespaces multiple times today. Twice I've been able to build the docs without any errors. Every other time I've built the docs I've encountered the exact same warning messages with an error at the last stage of the doc build.

WARNING: the pydata_sphinx_theme extension is not safe for parallel writing
WARNING: doing serial write

I've set up 7 different codespace environments today. My best guess is that when I build the docs from the main branch, I have no issues. When I build the docs from another branch, I get the warning messages.

To build the docs with codespaces, I'm using the following 5 commands.

conda activate numpy-dev
pip install -r requirements/build_requirements.txt
spin build
pip install --pre --force-reinstall --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple -r requirements/doc_requirements.txt
spin docs

@melissawm
Copy link
Member

Hi @bmwoodruff - the parallel safety warning is a known issue with the PyData Sphinx theme and something that will be fixed upstream. It should not impact the documentation build. Are you able to build despite the warning?

@bmwoodruff
Copy link
Member

Hi @melissawm , the docs build and are viewable, but the ending message suggests otherwise.

build finished with problems, 2 warnings.
make: *** [Makefile:144: html-build] Error 1
make: Leaving directory '/workspaces/numpy/doc'

I tried running the docs with SPHINXOPTS="" spin docs, following

SPHINXOPTS="" spin docs

I still encounter the make error. Since the docs still build and things are viewable, I've ignored the error message for now. Mostly it's a bit confusing for a newbie. This was the only reference to this warning on the numpy site, so I figured I'd add a comment. I did find your conversations on scipy, and the linked discussion on pydata, all related to the same issue.

bmwoodruff added a commit to bmwoodruff/numpy that referenced this pull request May 19, 2024
This commit tries to solve two problems.
- The pydata_sphinx_theme extension warning can be avoided by setting
the default `--jobs` to `1`. This matches `spin test`.
- The -W option is currently hardcoded in ALLSPHINXOPTS and
impossible to override. This commit moves `-W` to SPHINXOPTS which
allows a local machine to remove -W if needed, as described in the
documentation. This adds to the discussion in PR numpy#26125.

[skip actions] [skip azp] [skip cirrus]
charris pushed a commit to charris/numpy that referenced this pull request Jun 9, 2024
This commit tries to solve two problems.
- The pydata_sphinx_theme extension warning can be avoided by setting
the default `--jobs` to `1`. This matches `spin test`.
- The -W option is currently hardcoded in ALLSPHINXOPTS and
impossible to override. This commit moves `-W` to SPHINXOPTS which
allows a local machine to remove -W if needed, as described in the
documentation. This adds to the discussion in PR numpy#26125.

[skip actions] [skip azp] [skip cirrus]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: Inaccessible contrast for a:visited links in admonitions
5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy