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

FIX: breaking style changes in pydata-sphinx-theme #841

Merged
merged 5 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ jobs:
pytest --durations=10 --cov=sphinx_book_theme --cov-report=xml --cov-report=term-missing

# Only upload to codecov on pull requests so that we don't trigger rate limit blocks
# Disabled for now with false &&
- name: Upload to Codecov
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'
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'
uses: codecov/[email protected]
with:
name: ebp-sbt-pytests-py3.7
Expand Down Expand Up @@ -111,7 +112,7 @@ jobs:
text = Path("./warnings.txt").read_text().strip()
expected_warning_patterns = [r"kitchen\-sink", r"urllib/parse\.py", r"Glyph 10024 .*? missing from current font"]
print("\n=== Sphinx Warnings ===\n\n" + text) # Print just for reference so we can look at the logs
unexpected = [l for l in text.splitlines() if not any(re.search(p, ii) for p in expected_warning_patterns)]
unexpected = [l for l in text.splitlines() if not any(re.search(p, l) for p in expected_warning_patterns)]
assert len(unexpected) == 0, unexpected

- name: Audit with Lighthouse
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
"http://someurl/release", # This is a fake link
"https://doi.org", # These don't resolve properly and cause SSL issues
]

linkcheck_exclude_documents = ["changelog"]

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

Expand Down
6 changes: 4 additions & 2 deletions docs/reference/special-theme-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,10 @@ An admonition with a sidenote defined in the admonition[^snam1] and another defi
These aren't theme-specific, but we still show below to make sure they work.

::::{note} Here's a note!
:::{tip} And a tip!
:::

```{tip} And a tip!
```

::::

## MyST Markdown elements
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@ doc = [
test = [
"beautifulsoup4",
"coverage",
"defusedxml",
"myst-nb",
"pytest",
"pytest-cov",
"pytest-regressions",
"sphinx_thebe",
"pydata-sphinx-theme>=0.15.2"
]

[project.entry-points]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Sidebar toggle over-rides for PST
*/
// Primary toggle is always visible
label.sidebar-toggle.primary-toggle {
button.sidebar-toggle.primary-toggle {
@media (min-width: $breakpoint-md) {
display: inline-block;
}
Expand All @@ -25,7 +25,7 @@ label.sidebar-toggle.primary-toggle {
}

// Secondary toggle mimics behavior of "persistent header" div of PST
label.sidebar-toggle.secondary-toggle {
button.sidebar-toggle.secondary-toggle {
@media (min-width: $breakpoint-lg) {
display: none;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// Turn these off because we'll show it in the article header
// The primary sidebar toggle
label.sidebar-toggle {
button.sidebar-toggle {
display: none;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
// It is shown by default, and hidden with a click.
// Mobile behavior is defined in the pydata sphinx theme
@media (min-width: $breakpoint-lg) {
input#__primary:checked ~ .bd-container .bd-sidebar-primary {
input#pst-primary-sidebar-checkbox:checked
~ .bd-container
.bd-sidebar-primary {
margin-left: -$sidebar-primary-width-widescreen;
visibility: hidden;
opacity: 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<label class="sidebar-toggle primary-toggle btn btn-sm" for="__primary" title="Toggle primary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<button class="sidebar-toggle primary-toggle btn btn-sm" title="Toggle primary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="fa-solid fa-bars"></span>
</label>
</button>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{# The in-page Table of Contents -#}
{% set page_toc = generate_toc_html() -%}
{% if page_toc -%}
<label class="sidebar-toggle secondary-toggle btn btn-sm" for="__secondary"title="Toggle secondary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<button class="sidebar-toggle secondary-toggle btn btn-sm" title="Toggle secondary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="fa-solid fa-list"></span>
</label>
</button>
{%- endif %}
6 changes: 3 additions & 3 deletions tests/test_build/build__header-article.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div class="bd-header-article">
<div class="bd-header-article d-print-none">
<div class="header-article-items header-article__inner">
<div class="header-article-items__start">
<div class="header-article-item">
<label class="sidebar-toggle primary-toggle btn btn-sm" data-bs-placement="bottom" data-bs-toggle="tooltip" for="__primary" title="Toggle primary sidebar">
<button class="sidebar-toggle primary-toggle btn btn-sm" data-bs-placement="bottom" data-bs-toggle="tooltip" title="Toggle primary sidebar">
<span class="fa-solid fa-bars">
</span>
</label>
</button>
</div>
</div>
<div class="header-article-items__end">
Expand Down
Loading