Skip to content

Commit b79fe4b

Browse files
timsaucerclaude
andcommitted
docs: refresh theme — pydata-sphinx-theme 0.16, top navbar, dark mode
Bump pydata-sphinx-theme 0.8.0 -> 0.16 to enable the modern navbar slot API and dark/light theme switcher. Configure top navbar with logo, nav links, GitHub icon, and theme switcher in conf.py. Drop the custom docs-sidebar.html override and the layout.html block that silenced the navbar — both predate the slot API and conflict with the new theme. Strip CSS overrides that fought the old theme (--pst-header-height: 0, navbar-brand sizing) and add a dark-mode variant for the inline code color and table-stripe shading. Fix the stale github_repo ("arrow-datafusion-python" -> "datafusion-python") so future Edit-on- GitHub links resolve. Bump copyright year and project name. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d021e6a commit b79fe4b

6 files changed

Lines changed: 92 additions & 75 deletions

File tree

docs/source/_static/theme_overrides.css

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -21,62 +21,34 @@
2121
/* Customizing with theme CSS variables */
2222

2323
:root {
24-
--pst-color-active-navigation: 215, 70, 51;
2524
--pst-color-link-hover: 215, 70, 51;
2625
--pst-color-headerlink: 215, 70, 51;
27-
/* Use normal text color (like h3, ..) instead of primary color */
28-
--pst-color-h1: var(--color-text-base);
29-
--pst-color-h2: var(--color-text-base);
30-
/* Use softer blue from bootstrap's default info color */
26+
/* Softer blue from bootstrap's default info color */
3127
--pst-color-info: 23, 162, 184;
32-
--pst-header-height: 0px;
3328
}
3429

3530
code {
3631
color: rgb(215, 70, 51);
3732
}
3833

39-
.footer {
40-
text-align: center;
41-
}
42-
43-
/* Ensure the logo is properly displayed */
44-
45-
.navbar-brand {
46-
height: auto;
47-
width: auto;
34+
html[data-theme="dark"] code {
35+
color: rgb(255, 138, 117);
4836
}
4937

50-
a.navbar-brand img {
51-
height: auto;
52-
width: auto;
53-
max-height: 15vh;
54-
max-width: 100%;
38+
.footer {
39+
text-align: center;
5540
}
5641

5742

58-
/* This is the bootstrap CSS style for "table-striped". Since the theme does
59-
not yet provide an easy way to configure this globally, it easier to simply
60-
include this snippet here than updating each table in all rst files to
61-
add ":class: table-striped" */
43+
/* Bootstrap "table-striped" applied globally so individual tables in
44+
user-guide pages don't need ":class: table-striped" added one by one. */
6245

6346
.table tbody tr:nth-of-type(odd) {
6447
background-color: rgba(0, 0, 0, 0.05);
6548
}
6649

67-
68-
/* Limit the max height of the sidebar navigation section. Because in our
69-
custimized template, there is more content above the navigation, i.e.
70-
larger logo: if we don't decrease the max-height, it will overlap with
71-
the footer.
72-
Details: min(15vh, 110px) for the logo size, 8rem for search box etc*/
73-
74-
@media (min-width:720px) {
75-
@supports (position:-webkit-sticky) or (position:sticky) {
76-
.bd-links {
77-
max-height: calc(100vh - min(15vh, 110px) - 8rem)
78-
}
79-
}
50+
html[data-theme="dark"] .table tbody tr:nth-of-type(odd) {
51+
background-color: rgba(255, 255, 255, 0.05);
8052
}
8153

8254

docs/source/_templates/docs-sidebar.html

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

docs/source/_templates/layout.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
{% extends "pydata_sphinx_theme/layout.html" %}
22

3-
{# Silence the navbar #}
4-
{% block docs_navbar %}
5-
{% endblock %}
6-
73
<!--
84
Custom footer
95
-->

docs/source/conf.py

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535

3636
# -- Project information -----------------------------------------------------
3737

38-
project = "Apache Arrow DataFusion"
39-
copyright = "2019-2024, Apache Software Foundation"
38+
project = "Apache DataFusion in Python"
39+
copyright = "2019-2026, Apache Software Foundation"
4040
author = "Apache Software Foundation"
4141

4242

@@ -115,13 +115,35 @@ def setup(sphinx) -> None:
115115
#
116116
html_theme = "pydata_sphinx_theme"
117117

118-
html_theme_options = {"use_edit_page_button": False, "show_toc_level": 2}
118+
html_theme_options = {
119+
"use_edit_page_button": False,
120+
"show_toc_level": 2,
121+
"logo": {
122+
"image_light": "_static/images/original.svg",
123+
"image_dark": "_static/images/original.svg",
124+
"alt_text": "Apache DataFusion in Python",
125+
},
126+
"navbar_start": ["navbar-logo"],
127+
"navbar_center": ["navbar-nav"],
128+
"navbar_end": ["navbar-icon-links", "theme-switcher"],
129+
"icon_links": [
130+
{
131+
"name": "GitHub",
132+
"url": "https://github.com/apache/datafusion-python",
133+
"icon": "fa-brands fa-github",
134+
},
135+
],
136+
"secondary_sidebar_items": [],
137+
"collapse_navigation": True,
138+
"show_nav_level": 1,
139+
}
119140

120141
html_context = {
121142
"github_user": "apache",
122-
"github_repo": "arrow-datafusion-python",
143+
"github_repo": "datafusion-python",
123144
"github_version": "main",
124145
"doc_path": "docs/source",
146+
"default_mode": "auto",
125147
}
126148

127149
# Add any paths that contain custom static files (such as style sheets) here,
@@ -133,14 +155,8 @@ def setup(sphinx) -> None:
133155
# resolve at conventional URLs like `https://.../python/llms.txt`.
134156
html_extra_path = ["llms.txt"]
135157

136-
html_logo = "_static/images/2x_bgwhite_original.png"
137-
138158
html_css_files = ["theme_overrides.css"]
139159

140-
html_sidebars = {
141-
"**": ["docs-sidebar.html"],
142-
}
143-
144160
# tell myst_parser to auto-generate anchor links for headers h1, h2, h3
145161
myst_heading_anchors = 3
146162

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,9 @@ docs = [
219219
"myst-parser>=3.0.1",
220220
"pandas>=2.0.3",
221221
"pickleshare>=0.7.5",
222-
"pydata-sphinx-theme==0.8.0",
222+
"pydata-sphinx-theme>=0.16,<0.17",
223223
"setuptools>=75.3.0",
224224
"sphinx-autoapi>=3.4.0",
225+
"sphinx-reredirects>=0.1.5",
225226
"sphinx>=7.1.2",
226227
]

uv.lock

Lines changed: 55 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)