Skip to content

Commit dc581fc

Browse files
authored
Merge pull request #17 from jangenoe/copilot/update-repo-sync
Sync fork with upstream executablebooks/sphinx-book-theme (8822eeff76b6c3)
2 parents 6f001d3 + 4bfb192 commit dc581fc

5 files changed

Lines changed: 37 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
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)
3+
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)
44

55
## The following files have been added:
66

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ filterwarnings = [
2121
# Sphinx triggers this
2222
'''ignore:'imghdr' is deprecated and slated for removal in Python 3\.13:DeprecationWarning''',
2323
'''ignore:'sphinx.util.import_object' is deprecated.:PendingDeprecationWarning''',
24-
'ignore:Parsing dates involving a day of month without a year specified is ambiguious:DeprecationWarning'
24+
'ignore:Parsing dates involving a day of month without a year specified is ambiguious:DeprecationWarning',
25+
'ignore:Argument "parser_name" will be removed in Docutils 2.0.:PendingDeprecationWarning',
2526
]
2627

2728

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@
1818
opacity variables.$animation-time ease 0s,
1919
visibility variables.$animation-time ease 0s;
2020

21+
// Hide sidebar when toggle button is clicked on wide screens
22+
&.pst-sidebar-hidden {
23+
@media (min-width: variables.$breakpoint-lg) {
24+
margin-left: -(variables.$sidebar-primary-width-widescreen);
25+
visibility: hidden;
26+
opacity: 0;
27+
}
28+
}
29+
2130
@media (max-width: variables.$breakpoint-md) {
2231
// So that tooltips don't overlap
2332
z-index: variables.$zindex-tooltip + 1;
@@ -28,6 +37,13 @@
2837
border-top: none;
2938
}
3039

40+
// Left-align icon badges with standard gap spacing instead of centering
41+
.navbar-icon-links {
42+
display: flex !important;
43+
justify-content: flex-start !important;
44+
gap: 0.5rem !important;
45+
}
46+
3147
// On wide screens we have a smaller sidebar width than PST
3248
@media (min-width: variables.$breakpoint-lg) {
3349
flex-basis: variables.$sidebar-primary-width-widescreen;

src/sphinx_book_theme/header_buttons/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def add_header_buttons(app, pagename, templatename, context, doctree):
117117
"tooltip": translation("Fullscreen mode"),
118118
"icon": "fas fa-expand",
119119
"label": "fullscreen-button",
120+
"classes": "pst-navbar-icon",
120121
}
121122
)
122123

src/sphinx_book_theme/header_buttons/launch.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def add_launch_buttons(
5454
"jupyterhub_url",
5555
"thebe",
5656
"colab_url",
57+
"jupyterlite_url",
5758
"use_lite_button",
5859
"use_reveal_button",
5960
"use_powerpoint_button",
@@ -123,6 +124,9 @@ def add_launch_buttons(
123124
binderhub_url = launch_buttons.get("binderhub_url", "").strip("/")
124125
colab_url = launch_buttons.get("colab_url", "").strip("/")
125126
deepnote_url = launch_buttons.get("deepnote_url", "").strip("/")
127+
# jupyterlite_url could be absolute but without a domain, so we only
128+
# strip trailing slashes, not leading ones
129+
jupyterlite_url = launch_buttons.get("jupyterlite_url", "").rstrip("/")
126130
lightning_studios_url = launch_buttons.get("lightning_studios_url", "").strip("/")
127131

128132
# Loop through each provider and add a button for it if needed
@@ -211,6 +215,19 @@ def add_launch_buttons(
211215
"url": url,
212216
}
213217
)
218+
if jupyterlite_url:
219+
jl_ext = launch_buttons.get("jupyterlite_ext", extension).strip()
220+
jl_rel_repo = f"{book_relpath}{pagename}{jl_ext}"
221+
url = f"{jupyterlite_url}?path={jl_rel_repo}"
222+
launch_buttons_list.append(
223+
{
224+
"type": "link",
225+
"text": "JupyterLite",
226+
"tooltip": "Launch via JupyterLite",
227+
"icon": "_static/images/logo_jupyterlite.svg",
228+
"url": url,
229+
}
230+
)
214231
# Add thebe flag in context
215232
if launch_buttons.get("thebe", False):
216233
launch_buttons_list.append(

0 commit comments

Comments
 (0)