Skip to content

Commit

Permalink
Bump napari sphinx theme version (#423)
Browse files Browse the repository at this point in the history
# References and relevant issues
Depends on napari/napari-sphinx-theme#161

(and a new release of the theme)

# Description
Restores the sidebar after the PyData Sphinx Theme is updated to version
0.15.3

---------

Co-authored-by: Juan Nunez-Iglesias <jni@fastmail.com>
Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 1, 2024
1 parent 21b8aa6 commit 7125f16
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ clean:

docs-install:
python -m pip install -qr $(current_dir)requirements.txt
python -m pip freeze

prep-docs:
python $(docs_dir)/_scripts/prep_docs.py
Expand Down
6 changes: 6 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ div.sphx-glr-download a:hover {
background-image: none;
background-color: #ffffff !important;
}

/* Workaround for https: //github.com/napari/docs/pull/423#issuecomment-2141165872 */
.bd-content .sd-tab-set>label {
background-color: var(--napari-gray);
color: #222832;
}
18 changes: 14 additions & 4 deletions docs/_templates/sidebar-nav-bs.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
<nav class="bd-docs-nav bd-links"
aria-label="{{ _('Section Navigation') }}">
<div class="bd-toc-item navbar-nav">{{ sidebar_nav_html }}</div>
</nav>
{# Displays the TOC-subtree for pages nested under the currently active top-level TOCtree element. #}
<nav class="bd-docs-nav bd-links" aria-label="{{ _('Section Navigation') }}">
<div class="bd-toc-item navbar-nav">
{{- generate_toctree_html(
"sidebar",
show_nav_level=theme_show_nav_level | int,
maxdepth=theme_navigation_depth | int,
collapse=theme_collapse_navigation | tobool,
includehidden=theme_sidebar_includehidden | tobool,
titles_only=True
)
-}}
</div>
</nav>
10 changes: 7 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@
version_match = release

html_theme_options = {
"external_links": [
{"name": "napari hub", "url": "https://napari-hub.org"}
],
"external_links": [{"name": "napari hub", "url": "https://napari-hub.org"}],
"github_url": "https://github.com/napari/napari",
"navbar_start": ["navbar-logo", "navbar-project"],
"navbar_end": ["version-switcher", "navbar-icon-links"],
Expand All @@ -116,6 +114,12 @@
"pygment_light_style": "napari",
"pygment_dark_style": "napari",
"announcement": "https://napari.org/dev/_static/announcement.html",
"back_to_top_button": False,
}

html_context = {
# use Light theme only, don't auto switch (default)
"default_mode": "light"
}

# Add any paths that contain custom static files (such as style sheets) here,
Expand Down

0 comments on commit 7125f16

Please sign in to comment.