Skip to content
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

This extended repository tracks the master branch [sphinx-book-theme] (https://github.com/executablebooks/sphinx-book-theme). The most recent commit of the master incorporated is [8822eef](https://github.com/executablebooks/sphinx-book-theme/commit/8822eeff673f14e627925a51070d5eeaf3360dbe)
This extended repository tracks the master branch [sphinx-book-theme] (https://github.com/executablebooks/sphinx-book-theme). The most recent commit of the master incorporated is [f76b6c3](https://github.com/executablebooks/sphinx-book-theme/commit/f76b6c3957f4beb105555e319d9e662755d17c95)

## The following files have been added:

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ filterwarnings = [
# Sphinx triggers this
'''ignore:'imghdr' is deprecated and slated for removal in Python 3\.13:DeprecationWarning''',
'''ignore:'sphinx.util.import_object' is deprecated.:PendingDeprecationWarning''',
'ignore:Parsing dates involving a day of month without a year specified is ambiguious:DeprecationWarning'
'ignore:Parsing dates involving a day of month without a year specified is ambiguious:DeprecationWarning',
'ignore:Argument "parser_name" will be removed in Docutils 2.0.:PendingDeprecationWarning',
]


Expand Down
16 changes: 16 additions & 0 deletions src/sphinx_book_theme/assets/styles/sections/_sidebar-primary.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
opacity variables.$animation-time ease 0s,
visibility variables.$animation-time ease 0s;

// Hide sidebar when toggle button is clicked on wide screens
&.pst-sidebar-hidden {
@media (min-width: variables.$breakpoint-lg) {
margin-left: -(variables.$sidebar-primary-width-widescreen);
visibility: hidden;
opacity: 0;
}
}

@media (max-width: variables.$breakpoint-md) {
// So that tooltips don't overlap
z-index: variables.$zindex-tooltip + 1;
Expand All @@ -28,6 +37,13 @@
border-top: none;
}

// Left-align icon badges with standard gap spacing instead of centering
.navbar-icon-links {
display: flex !important;
justify-content: flex-start !important;
gap: 0.5rem !important;
}

// On wide screens we have a smaller sidebar width than PST
@media (min-width: variables.$breakpoint-lg) {
flex-basis: variables.$sidebar-primary-width-widescreen;
Expand Down
1 change: 1 addition & 0 deletions src/sphinx_book_theme/header_buttons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def add_header_buttons(app, pagename, templatename, context, doctree):
"tooltip": translation("Fullscreen mode"),
"icon": "fas fa-expand",
"label": "fullscreen-button",
"classes": "pst-navbar-icon",
}
)

Expand Down
17 changes: 17 additions & 0 deletions src/sphinx_book_theme/header_buttons/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def add_launch_buttons(
"jupyterhub_url",
"thebe",
"colab_url",
"jupyterlite_url",
"use_lite_button",
"use_reveal_button",
"use_powerpoint_button",
Expand Down Expand Up @@ -123,6 +124,9 @@ def add_launch_buttons(
binderhub_url = launch_buttons.get("binderhub_url", "").strip("/")
colab_url = launch_buttons.get("colab_url", "").strip("/")
deepnote_url = launch_buttons.get("deepnote_url", "").strip("/")
# jupyterlite_url could be absolute but without a domain, so we only
# strip trailing slashes, not leading ones
jupyterlite_url = launch_buttons.get("jupyterlite_url", "").rstrip("/")
lightning_studios_url = launch_buttons.get("lightning_studios_url", "").strip("/")

# Loop through each provider and add a button for it if needed
Expand Down Expand Up @@ -211,6 +215,19 @@ def add_launch_buttons(
"url": url,
}
)
if jupyterlite_url:
jl_ext = launch_buttons.get("jupyterlite_ext", extension).strip()
jl_rel_repo = f"{book_relpath}{pagename}{jl_ext}"
url = f"{jupyterlite_url}?path={jl_rel_repo}"
launch_buttons_list.append(
{
"type": "link",
"text": "JupyterLite",
"tooltip": "Launch via JupyterLite",
"icon": "_static/images/logo_jupyterlite.svg",
"url": url,
}
)
# Add thebe flag in context
if launch_buttons.get("thebe", False):
launch_buttons_list.append(
Expand Down