Skip to content
Closed
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
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
"binderhub_url": "https://mybinder.org",
"colab_url": "https://colab.research.google.com/",
"deepnote_url": "https://deepnote.com/",
"basthon_url": "https://notebook.basthon.fr/",
"notebook_interface": "jupyterlab",
"thebe": True,
# "jupyterhub_url": "https://datahub.berkeley.edu", # For testing
Expand Down
13 changes: 13 additions & 0 deletions src/sphinx_book_theme/header_buttons/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def add_launch_buttons(
jupyterhub_url = launch_buttons.get("jupyterhub_url", "").strip("/")
binderhub_url = launch_buttons.get("binderhub_url", "").strip("/")
colab_url = launch_buttons.get("colab_url", "").strip("/")
basthon_url = launch_buttons.get("basthon_url", "").strip("/")
deepnote_url = launch_buttons.get("deepnote_url", "").strip("/")
if binderhub_url:
url = (
Expand Down Expand Up @@ -161,6 +162,18 @@ def add_launch_buttons(
}
)

if basthon_url:
url = f"{basthon_url}/?from=https://raw.githubusercontent.com/{org}/{repo}/{branch}/{path_rel_repo}"
launch_buttons_list.append(
{
"type": "link",
"text": "Basthon",
"tooltip": "Launch on Basthon",
"icon": "_static/images/logo_basthon.svg",
"url": url,
}
)

# Add thebe flag in context
if launch_buttons.get("thebe", False):
launch_buttons_list.append(
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tests/sites/base/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"jupyterhub_url": "https://datahub.berkeley.edu",
"colab_url": "https://colab.research.google.com",
"deepnote_url": "https://deepnote.com",
"basthon_url": "https://notebook.basthon.fr",
"notebook_interface": "jupyterlab",
"thebe": True,
},
Expand Down
10 changes: 10 additions & 0 deletions tests/test_build/build__header-article.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@
</span>
</a>
</li>
<li>
<a class="headerbtn" data-placement="left" data-toggle="tooltip" href="https://notebook.basthon.fr/?from=https://raw.githubusercontent.com/executablebooks/sphinx-book-theme/master/TESTPATH/section1/ntbk.ipynb" title="Launch on Basthon">
<span class="headerbtn__icon-container">
<img src="../_static/images/logo_basthon.svg"/>
</span>
<span class="headerbtn__text-container">
Basthon
</span>
</a>
</li>
<li>
<button class="headerbtn headerbtn-launch-thebe" data-placement="left" data-toggle="tooltip" onclick="initThebeSBT()" title="Launch Thebe">
<span class="headerbtn__icon-container">
Expand Down
10 changes: 10 additions & 0 deletions tests/test_build/test_header_launchbtns.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
</span>
</a>
</li>
<li>
<a class="headerbtn" data-placement="left" data-toggle="tooltip" href="https://notebook.basthon.fr/?from=https://raw.githubusercontent.com/executablebooks/sphinx-book-theme/master/TESTPATH/section1/ntbk.ipynb" title="Launch on Basthon">
<span class="headerbtn__icon-container">
<img src="../_static/images/logo_basthon.svg"/>
</span>
<span class="headerbtn__text-container">
Basthon
</span>
</a>
</li>
<li>
<button class="headerbtn headerbtn-launch-thebe" data-placement="left" data-toggle="tooltip" onclick="initThebeSBT()" title="Launch Thebe">
<span class="headerbtn__icon-container">
Expand Down