Skip to content

Commit 3672ba6

Browse files
authored
Merge pull request numpy#26125 from hugovk/bump-pydata-sphinx-theme
DOC: Bump pydata-sphinx-theme version
2 parents 3c09f16 + 8e4414d commit 3672ba6

File tree

7 files changed

+68
-150
lines changed

7 files changed

+68
-150
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
. venv/bin/activate
7575
cd doc
7676
# Don't use -q, show warning summary"
77-
SPHINXOPTS="-j2 -n" make -e html
77+
SPHINXOPTS="-n" make -e html
7878
if [[ $(find build/html -type f | wc -l) -lt 1000 ]]; then
7979
echo "doc build failed: build/html is empty"
8080
exit -1
@@ -85,7 +85,7 @@ jobs:
8585
command: |
8686
. venv/bin/activate
8787
cd doc/neps
88-
SPHINXOPTS="-j2 -n" make -e html || echo "ignoring errors for now"
88+
SPHINXOPTS="-n" make -e html || echo "ignoring errors for now"
8989
9090
- store_artifacts:
9191
path: doc/build/html/

doc/release/upcoming_changes/25908.improvement.rst

Lines changed: 0 additions & 5 deletions
This file was deleted.

doc/source/_static/numpy.css

Lines changed: 27 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -9,132 +9,47 @@
99

1010
body {
1111
font-family: 'Open Sans', sans-serif;
12+
font-size: medium;
1213
}
1314

14-
pre, code {
15-
font-size: 100%;
16-
line-height: 155%;
17-
}
18-
19-
h1 {
20-
font-family: "Lato", sans-serif;
21-
color: #013243; /* warm black */
22-
}
23-
24-
h2 {
25-
color: #4d77cf; /* han blue */
26-
letter-spacing: -.03em;
27-
}
28-
29-
h3 {
30-
color: #013243; /* warm black */
31-
letter-spacing: -.03em;
32-
}
33-
34-
/* Style the active version button.
35-
36-
- dev: orange
37-
- stable: green
38-
- old, PR: red
39-
40-
Colors from:
41-
42-
Wong, B. Points of view: Color blindness.
43-
Nat Methods 8, 441 (2011). https://doi.org/10.1038/nmeth.1618
44-
*/
15+
/* Version switcher colors from PyData Sphinx Theme */
4516

46-
/* If the active version has the name "dev", style it orange */
47-
#version_switcher_button[data-active-version-name*="dev"] {
48-
background-color: #E69F00;
49-
border-color: #E69F00;
50-
color:#000000;
51-
}
52-
53-
/* green for `stable` */
54-
#version_switcher_button[data-active-version-name*="stable"] {
55-
background-color: #009E73;
56-
border-color: #009E73;
17+
.version-switcher__button[data-active-version-name*="devdocs"] {
18+
background-color: var(--pst-color-warning);
19+
border-color: var(--pst-color-warning);
20+
opacity: 0.9;
5721
}
5822

59-
/* red for `old` */
60-
#version_switcher_button:not([data-active-version-name*="stable"], [data-active-version-name*="dev"], [data-active-version-name=""]) {
61-
background-color: #980F0F;
62-
border-color: #980F0F;
23+
.version-switcher__button:not([data-active-version-name*="stable"]):not([data-active-version-name*="dev"]):not([data-active-version-name*="pull"]) {
24+
background-color: var(--pst-color-danger);
25+
border-color: var(--pst-color-danger);
26+
opacity: 0.9;
6327
}
6428

65-
/* Main page overview cards */
66-
67-
.sd-card {
68-
background: #fff;
69-
border-radius: 0;
70-
padding: 30px 10px 20px 10px;
71-
margin: 10px 0px;
29+
.version-switcher__menu a.list-group-item {
30+
font-size: small;
7231
}
7332

74-
.sd-card .sd-card-header {
75-
text-align: center;
33+
button.btn.version-switcher__button,
34+
button.btn.version-switcher__button:hover {
35+
color: black;
36+
font-size: small;
7637
}
7738

78-
.sd-card .sd-card-header .sd-card-text {
79-
margin: 0px;
80-
}
39+
/* Main index page overview cards */
8140

8241
.sd-card .sd-card-img-top {
83-
height: 52px;
84-
width: 52px;
42+
height: 60px;
43+
width: 60px;
8544
margin-left: auto;
8645
margin-right: auto;
46+
margin-top: 10px;
8747
}
8848

89-
.sd-card .sd-card-header {
90-
border: none;
91-
background-color: white;
92-
color: #150458 !important;
93-
font-size: var(--pst-font-size-h5);
94-
font-weight: bold;
95-
padding: 2.5rem 0rem 0.5rem 0rem;
96-
}
97-
98-
.sd-card .sd-card-footer {
99-
border: none;
100-
background-color: white;
101-
}
102-
103-
.sd-card .sd-card-footer .sd-card-text {
104-
max-width: 220px;
105-
margin-left: auto;
106-
margin-right: auto;
107-
}
49+
/* Main index page overview images */
10850

109-
/* Dark theme tweaking */
11051
html[data-theme=dark] .sd-card img[src*='.svg'] {
111-
filter: invert(0.82) brightness(0.8) contrast(1.2);
112-
}
113-
114-
/* Main index page overview cards */
115-
html[data-theme=dark] .sd-card {
116-
background-color:var(--pst-color-background);
117-
}
118-
119-
html[data-theme=dark] .sd-shadow-sm {
120-
box-shadow: 0 .1rem 1rem rgba(250, 250, 250, .6) !important
121-
}
122-
123-
html[data-theme=dark] .sd-card .sd-card-header {
124-
background-color:var(--pst-color-background);
125-
color: #150458 !important;
126-
}
127-
128-
html[data-theme=dark] .sd-card .sd-card-footer {
129-
background-color:var(--pst-color-background);
130-
}
131-
132-
html[data-theme=dark] h1 {
133-
color: var(--pst-color-primary);
134-
}
135-
136-
html[data-theme=dark] h3 {
137-
color: #0a6774;
52+
filter: invert(0.82) brightness(0.8) contrast(1.2);
13853
}
13954

14055
/* Legacy admonition */
@@ -143,15 +58,12 @@ div.admonition-legacy {
14358
border-color: var(--pst-color-warning);
14459
}
14560

146-
.admonition-legacy.admonition>.admonition-title::before,
147-
div.admonition>.admonition-title::before {
61+
.admonition>.admonition-title::after,
62+
div.admonition>.admonition-title::after {
14863
color: var(--pst-color-warning);
149-
content: var(--pst-icon-admonition-attention);
150-
background-color: var(--pst-color-warning);
15164
}
15265

153-
.admonition-legacy.admonition>.admonition-title::after,
154-
div.admonition>.admonition-title::after {
155-
color: var(--pst-color-warning);
156-
content: var(--pst-icon-admonition-default);
66+
.admonition>.admonition-title,
67+
div.admonition>.admonition-title {
68+
background-color: var(--pst-color-warning-bg);
15769
}

doc/source/conf.py

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -239,23 +239,29 @@ def setup(app):
239239
switcher_version = f"{version}"
240240

241241
html_theme_options = {
242-
"logo": {
243-
"image_light": "_static/numpylogo.svg",
244-
"image_dark": "_static/numpylogo_dark.svg",
245-
},
246-
"github_url": "https://github.com/numpy/numpy",
247-
"collapse_navigation": True,
248-
"external_links": [
249-
{"name": "Learn", "url": "https://numpy.org/numpy-tutorials/"},
250-
{"name": "NEPs", "url": "https://numpy.org/neps"}
251-
],
252-
"header_links_before_dropdown": 6,
253-
# Add light/dark mode and documentation version switcher:
254-
"navbar_end": ["theme-switcher", "version-switcher", "navbar-icon-links"],
255-
"switcher": {
256-
"version_match": switcher_version,
257-
"json_url": "https://numpy.org/doc/_static/versions.json",
258-
},
242+
"logo": {
243+
"image_light": "_static/numpylogo.svg",
244+
"image_dark": "_static/numpylogo_dark.svg",
245+
},
246+
"github_url": "https://github.com/numpy/numpy",
247+
"collapse_navigation": True,
248+
"external_links": [
249+
{"name": "Learn", "url": "https://numpy.org/numpy-tutorials/"},
250+
{"name": "NEPs", "url": "https://numpy.org/neps"},
251+
],
252+
"header_links_before_dropdown": 6,
253+
# Add light/dark mode and documentation version switcher:
254+
"navbar_end": [
255+
"search-button",
256+
"theme-switcher",
257+
"version-switcher",
258+
"navbar-icon-links"
259+
],
260+
"navbar_persistent": [],
261+
"switcher": {
262+
"version_match": switcher_version,
263+
"json_url": "https://numpy.org/doc/_static/versions.json",
264+
},
259265
}
260266

261267
html_title = "%s v%s Manual" % (project, version)

doc/source/index.rst

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ NumPy documentation
2121
`Historical versions of documentation <https://numpy.org/doc/>`_
2222

2323
**Useful links**:
24-
`Installation <https://numpy.org/install/>`_ |
25-
`Source Repository <https://github.com/numpy/numpy>`_ |
26-
`Issue Tracker <https://github.com/numpy/numpy/issues>`_ |
27-
`Q&A Support <https://numpy.org/gethelp/>`_ |
24+
`Installation <https://numpy.org/install/>`_ |
25+
`Source Repository <https://github.com/numpy/numpy>`_ |
26+
`Issue Tracker <https://github.com/numpy/numpy/issues>`_ |
27+
`Q&A Support <https://numpy.org/gethelp/>`_ |
2828
`Mailing List <https://mail.python.org/mailman/listinfo/numpy-discussion>`_
2929

3030
NumPy is the fundamental package for scientific computing in Python. It is a
@@ -36,13 +36,15 @@ basic statistical operations, random simulation and much more.
3636

3737

3838

39-
.. grid:: 2
39+
.. grid:: 1 1 2 2
40+
:gutter: 2 3 4 4
4041

4142
.. grid-item-card::
4243
:img-top: ../source/_static/index-images/getting_started.svg
44+
:text-align: center
4345

4446
Getting started
45-
^^^^^^^^^^^^^^^
47+
^^^
4648

4749
New to NumPy? Check out the Absolute Beginner's Guide. It contains an
4850
introduction to NumPy's main concepts and links to additional tutorials.
@@ -58,9 +60,10 @@ basic statistical operations, random simulation and much more.
5860

5961
.. grid-item-card::
6062
:img-top: ../source/_static/index-images/user_guide.svg
63+
:text-align: center
6164

6265
User guide
63-
^^^^^^^^^^
66+
^^^
6467

6568
The user guide provides in-depth information on the
6669
key concepts of NumPy with useful background information and explanation.
@@ -76,9 +79,10 @@ basic statistical operations, random simulation and much more.
7679

7780
.. grid-item-card::
7881
:img-top: ../source/_static/index-images/api.svg
82+
:text-align: center
7983

8084
API reference
81-
^^^^^^^^^^^^^
85+
^^^
8286

8387
The reference guide contains a detailed description of the functions,
8488
modules, and objects included in NumPy. The reference describes how the
@@ -96,9 +100,10 @@ basic statistical operations, random simulation and much more.
96100

97101
.. grid-item-card::
98102
:img-top: ../source/_static/index-images/contributor.svg
103+
:text-align: center
99104

100105
Contributor's guide
101-
^^^^^^^^^^^^^^^^^^^
106+
^^^
102107

103108
Want to add to the codebase? Can help add translation or a flowchart to the
104109
documentation? The contributing guidelines will guide you through the

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ dependencies:
3535
- scipy
3636
- pandas
3737
- matplotlib
38-
- pydata-sphinx-theme=0.13.3
38+
- pydata-sphinx-theme=0.15.2
3939
- doxygen
4040
# NOTE: breathe 4.33.0 collides with sphinx.ext.graphviz
4141
- breathe>4.33.0

requirements/doc_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# doxygen required, use apt-get or dnf
22
sphinx>=4.5.0
33
numpydoc==1.4
4-
pydata-sphinx-theme==0.13.3
4+
pydata-sphinx-theme==0.15.2
55
sphinx-design
66
scipy
77
matplotlib

0 commit comments

Comments
 (0)