Skip to content

Commit 3b6fd68

Browse files
authored
Merge pull request #841 from executablebooks/agoose77/fix-pydata-sphinx-theme-update
FIX: breaking style changes in pydata-sphinx-theme
2 parents 6f1560e + 2e53d46 commit 3b6fd68

File tree

10 files changed

+23
-16
lines changed

10 files changed

+23
-16
lines changed

.github/workflows/tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ jobs:
6363
pytest --durations=10 --cov=sphinx_book_theme --cov-report=xml --cov-report=term-missing
6464
6565
# Only upload to codecov on pull requests so that we don't trigger rate limit blocks
66+
# Disabled for now with false &&
6667
- name: Upload to Codecov
67-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9 && matrix.sphinx == '~=7.0' && github.repository == 'executablebooks/sphinx-book-theme' && github.event_name == 'pull_request'
68+
if: false && matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9 && matrix.sphinx == '~=7.0' && github.repository == 'executablebooks/sphinx-book-theme' && github.event_name == 'pull_request'
6869
uses: codecov/[email protected]
6970
with:
7071
name: ebp-sbt-pytests-py3.7
@@ -111,7 +112,7 @@ jobs:
111112
text = Path("./warnings.txt").read_text().strip()
112113
expected_warning_patterns = [r"kitchen\-sink", r"urllib/parse\.py", r"Glyph 10024 .*? missing from current font"]
113114
print("\n=== Sphinx Warnings ===\n\n" + text) # Print just for reference so we can look at the logs
114-
unexpected = [l for l in text.splitlines() if not any(re.search(p, ii) for p in expected_warning_patterns)]
115+
unexpected = [l for l in text.splitlines() if not any(re.search(p, l) for p in expected_warning_patterns)]
115116
assert len(unexpected) == 0, unexpected
116117
117118
- name: Audit with Lighthouse

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
"http://someurl/release", # This is a fake link
188188
"https://doi.org", # These don't resolve properly and cause SSL issues
189189
]
190-
190+
linkcheck_exclude_documents = ["changelog"]
191191

192192
# -- Download latest theme elements page from PyData -----------------------------
193193

docs/reference/special-theme-elements.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,10 @@ An admonition with a sidenote defined in the admonition[^snam1] and another defi
301301
These aren't theme-specific, but we still show below to make sure they work.
302302

303303
::::{note} Here's a note!
304-
:::{tip} And a tip!
305-
:::
304+
305+
```{tip} And a tip!
306+
```
307+
306308
::::
307309

308310
## MyST Markdown elements

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@ doc = [
8181
test = [
8282
"beautifulsoup4",
8383
"coverage",
84+
"defusedxml",
8485
"myst-nb",
8586
"pytest",
8687
"pytest-cov",
8788
"pytest-regressions",
8889
"sphinx_thebe",
90+
"pydata-sphinx-theme>=0.15.2"
8991
]
9092

9193
[project.entry-points]

src/sphinx_book_theme/assets/styles/sections/_header-article.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Sidebar toggle over-rides for PST
1616
*/
1717
// Primary toggle is always visible
18-
label.sidebar-toggle.primary-toggle {
18+
button.sidebar-toggle.primary-toggle {
1919
@media (min-width: $breakpoint-md) {
2020
display: inline-block;
2121
}
@@ -25,7 +25,7 @@ label.sidebar-toggle.primary-toggle {
2525
}
2626

2727
// Secondary toggle mimics behavior of "persistent header" div of PST
28-
label.sidebar-toggle.secondary-toggle {
28+
button.sidebar-toggle.secondary-toggle {
2929
@media (min-width: $breakpoint-lg) {
3030
display: none;
3131
}

src/sphinx_book_theme/assets/styles/sections/_header-primary.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Turn these off because we'll show it in the article header
66
// The primary sidebar toggle
7-
label.sidebar-toggle {
7+
button.sidebar-toggle {
88
display: none;
99
}
1010
}

src/sphinx_book_theme/assets/styles/sections/_sidebar-primary.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636
// It is shown by default, and hidden with a click.
3737
// Mobile behavior is defined in the pydata sphinx theme
3838
@media (min-width: $breakpoint-lg) {
39-
input#__primary:checked ~ .bd-container .bd-sidebar-primary {
39+
input#pst-primary-sidebar-checkbox:checked
40+
~ .bd-container
41+
.bd-sidebar-primary {
4042
margin-left: -$sidebar-primary-width-widescreen;
4143
visibility: hidden;
4244
opacity: 0;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<label class="sidebar-toggle primary-toggle btn btn-sm" for="__primary" title="Toggle primary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
1+
<button class="sidebar-toggle primary-toggle btn btn-sm" title="Toggle primary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
22
<span class="fa-solid fa-bars"></span>
3-
</label>
3+
</button>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{# The in-page Table of Contents -#}
22
{% set page_toc = generate_toc_html() -%}
33
{% if page_toc -%}
4-
<label class="sidebar-toggle secondary-toggle btn btn-sm" for="__secondary"title="Toggle secondary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
4+
<button class="sidebar-toggle secondary-toggle btn btn-sm" title="Toggle secondary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
55
<span class="fa-solid fa-list"></span>
6-
</label>
6+
</button>
77
{%- endif %}

tests/test_build/build__header-article.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<div class="bd-header-article">
1+
<div class="bd-header-article d-print-none">
22
<div class="header-article-items header-article__inner">
33
<div class="header-article-items__start">
44
<div class="header-article-item">
5-
<label class="sidebar-toggle primary-toggle btn btn-sm" data-bs-placement="bottom" data-bs-toggle="tooltip" for="__primary" title="Toggle primary sidebar">
5+
<button class="sidebar-toggle primary-toggle btn btn-sm" data-bs-placement="bottom" data-bs-toggle="tooltip" title="Toggle primary sidebar">
66
<span class="fa-solid fa-bars">
77
</span>
8-
</label>
8+
</button>
99
</div>
1010
</div>
1111
<div class="header-article-items__end">

0 commit comments

Comments
 (0)