File tree Expand file tree Collapse file tree 7 files changed +54
-0
lines changed
theme/sphinx_book_theme/static/images Expand file tree Collapse file tree 7 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 113
113
"binderhub_url" : "https://mybinder.org" ,
114
114
"colab_url" : "https://colab.research.google.com/" ,
115
115
"deepnote_url" : "https://deepnote.com/" ,
116
+ "basthon_url" : "https://notebook.basthon.fr/" ,
116
117
"notebook_interface" : "jupyterlab" ,
117
118
"thebe" : True ,
118
119
# "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 = {
67
67
...
68
68
}
69
69
```
70
+
70
71
## Deepnote
71
72
72
73
To add [ Deepnote] ( https://deepnote.com ) links to your page, add the following configuration:
@@ -85,6 +86,23 @@ html_theme_options = {
85
86
This will create a new Deepnote project every time you click the launch button.
86
87
```
87
88
89
+ ## Basthon
90
+
91
+ To add [ Basthon] ( https://basthon.fr/ ) 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
+ ```
88
106
89
107
## Live code cells with Thebe
90
108
Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ def add_launch_buttons(
114
114
jupyterhub_url = launch_buttons .get ("jupyterhub_url" , "" ).strip ("/" )
115
115
binderhub_url = launch_buttons .get ("binderhub_url" , "" ).strip ("/" )
116
116
colab_url = launch_buttons .get ("colab_url" , "" ).strip ("/" )
117
+ basthon_url = launch_buttons .get ("basthon_url" , "" ).strip ("/" )
117
118
deepnote_url = launch_buttons .get ("deepnote_url" , "" ).strip ("/" )
118
119
119
120
# Loop through each provider and add a button for it if needed
@@ -188,6 +189,19 @@ def add_launch_buttons(
188
189
}
189
190
)
190
191
192
+ if basthon_url :
193
+ gh = "https://raw.githubusercontent.com"
194
+ url = f"{ basthon_url } /?from={ gh } /{ org } /{ repo } /{ branch } /{ path_rel_repo } "
195
+ launch_buttons_list .append (
196
+ {
197
+ "type" : "link" ,
198
+ "text" : "Basthon" ,
199
+ "tooltip" : "Launch on Basthon" ,
200
+ "icon" : "_static/images/logo_basthon.png" ,
201
+ "url" : url ,
202
+ }
203
+ )
204
+
191
205
# Add thebe flag in context
192
206
if launch_buttons .get ("thebe" , False ):
193
207
launch_buttons_list .append (
Original file line number Diff line number Diff line change 27
27
"jupyterhub_url" : "https://datahub.berkeley.edu" ,
28
28
"colab_url" : "https://colab.research.google.com" ,
29
29
"deepnote_url" : "https://deepnote.com" ,
30
+ "basthon_url" : "https://notebook.basthon.fr" ,
30
31
"notebook_interface" : "jupyterlab" ,
31
32
"thebe" : True ,
32
33
},
Original file line number Diff line number Diff line change 57
57
</ span >
58
58
</ a >
59
59
</ li >
60
+ < li >
61
+ < a class ="btn btn-sm dropdown-item " data-bs-placement ="left " data-bs-toggle ="tooltip " href ="https://notebook.basthon.fr/?from=https://raw.githubusercontent.com/executablebooks/sphinx-book-theme/master/TESTPATH/section1/ntbk.ipynb " target ="_blank " title ="Launch on Basthon ">
62
+ < span class ="btn__icon-container ">
63
+ < img src ="../_static/images/logo_basthon.png "/>
64
+ </ span >
65
+ < span class ="btn__text-container ">
66
+ Basthon
67
+ </ span >
68
+ </ a >
69
+ </ li >
60
70
< li >
61
71
< button class ="btn btn-sm btn-launch-thebe dropdown-item " data-bs-placement ="left " data-bs-toggle ="tooltip " onclick ="initThebeSBT() " title ="Launch Thebe ">
62
72
< span class ="btn__icon-container ">
Original file line number Diff line number Diff line change 44
44
</ span >
45
45
</ a >
46
46
</ li >
47
+ < li >
48
+ < a class ="btn btn-sm dropdown-item " data-bs-placement ="left " data-bs-toggle ="tooltip " href ="https://notebook.basthon.fr/?from=https://raw.githubusercontent.com/executablebooks/sphinx-book-theme/master/TESTPATH/section1/ntbk.ipynb " target ="_blank " title ="Launch on Basthon ">
49
+ < span class ="btn__icon-container ">
50
+ < img src ="../_static/images/logo_basthon.png "/>
51
+ </ span >
52
+ < span class ="btn__text-container ">
53
+ Basthon
54
+ </ span >
55
+ </ a >
56
+ </ li >
47
57
< li >
48
58
< button class ="btn btn-sm btn-launch-thebe dropdown-item " data-bs-placement ="left " data-bs-toggle ="tooltip " onclick ="initThebeSBT() " title ="Launch Thebe ">
49
59
< span class ="btn__icon-container ">
You can’t perform that action at this time.
0 commit comments