File tree Expand file tree Collapse file tree 7 files changed +116
-0
lines changed
theme/sphinx_book_theme/static/images Expand file tree Collapse file tree 7 files changed +116
-0
lines changed Original file line number Diff line number Diff line change 111111 "binderhub_url" : "https://mybinder.org" ,
112112 "colab_url" : "https://colab.research.google.com/" ,
113113 "deepnote_url" : "https://deepnote.com/" ,
114+ "basthon_url" : "https://notebook.basthon.fr/" ,
114115 "notebook_interface" : "jupyterlab" ,
115116 "thebe" : True ,
116117 # "jupyterhub_url": "https://datahub.berkeley.edu", # For testing
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ html_theme_options = {
6767 ...
6868}
6969```
70+
7071## Deepnote
7172
7273To add [ Deepnote] ( https://deepnote.com ) links to your page, add the following configuration:
@@ -85,6 +86,23 @@ html_theme_options = {
8586This will create a new Deepnote project every time you click the launch button.
8687```
8788
89+ ## Basthon
90+
91+ To add Basthon links to your page, add the following configuration:
92+
93+ ``` python
94+ html_theme_options = {
95+ ...
96+ " launch_buttons" : {
97+ " basthon_url" : " https://notebook.basthon.fr"
98+ },
99+ ...
100+ }
101+ ```
102+
103+ ``` {tip}
104+ By default, a Python kernel is used. You can add "/sql" or "/ocaml" to basthon_url to run a notebook with another language.
105+ ```
88106
89107## Live code cells with Thebe
90108
Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ def add_launch_buttons(
102102 jupyterhub_url = launch_buttons .get ("jupyterhub_url" , "" ).strip ("/" )
103103 binderhub_url = launch_buttons .get ("binderhub_url" , "" ).strip ("/" )
104104 colab_url = launch_buttons .get ("colab_url" , "" ).strip ("/" )
105+ basthon_url = launch_buttons .get ("basthon_url" , "" ).strip ("/" )
105106 deepnote_url = launch_buttons .get ("deepnote_url" , "" ).strip ("/" )
106107 if binderhub_url :
107108 url = (
@@ -161,6 +162,19 @@ def add_launch_buttons(
161162 }
162163 )
163164
165+ if basthon_url :
166+ gh = "https://raw.githubusercontent.com"
167+ url = f"{ basthon_url } /?from={ gh } /{ org } /{ repo } /{ branch } /{ path_rel_repo } "
168+ launch_buttons_list .append (
169+ {
170+ "type" : "link" ,
171+ "text" : "Basthon" ,
172+ "tooltip" : "Launch on Basthon" ,
173+ "icon" : "_static/images/logo_basthon.svg" ,
174+ "url" : url ,
175+ }
176+ )
177+
164178 # Add thebe flag in context
165179 if launch_buttons .get ("thebe" , False ):
166180 launch_buttons_list .append (
Original file line number Diff line number Diff line change 2727 "jupyterhub_url" : "https://datahub.berkeley.edu" ,
2828 "colab_url" : "https://colab.research.google.com" ,
2929 "deepnote_url" : "https://deepnote.com" ,
30+ "basthon_url" : "https://notebook.basthon.fr" ,
3031 "notebook_interface" : "jupyterlab" ,
3132 "thebe" : True ,
3233 },
Original file line number Diff line number Diff line change 5656 </ span >
5757 </ a >
5858 </ li >
59+ < li >
60+ < 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 ">
61+ < span class ="headerbtn__icon-container ">
62+ < img src ="../_static/images/logo_basthon.svg "/>
63+ </ span >
64+ < span class ="headerbtn__text-container ">
65+ Basthon
66+ </ span >
67+ </ a >
68+ </ li >
5969 < li >
6070 < button class ="headerbtn headerbtn-launch-thebe " data-placement ="left " data-toggle ="tooltip " onclick ="initThebeSBT() " title ="Launch Thebe ">
6171 < span class ="headerbtn__icon-container ">
Original file line number Diff line number Diff line change 4545 </ span >
4646 </ a >
4747 </ li >
48+ < li >
49+ < 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 ">
50+ < span class ="headerbtn__icon-container ">
51+ < img src ="../_static/images/logo_basthon.svg "/>
52+ </ span >
53+ < span class ="headerbtn__text-container ">
54+ Basthon
55+ </ span >
56+ </ a >
57+ </ li >
4858 < li >
4959 < button class ="headerbtn headerbtn-launch-thebe " data-placement ="left " data-toggle ="tooltip " onclick ="initThebeSBT() " title ="Launch Thebe ">
5060 < span class ="headerbtn__icon-container ">
You can’t perform that action at this time.
0 commit comments