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 111
111
"binderhub_url" : "https://mybinder.org" ,
112
112
"colab_url" : "https://colab.research.google.com/" ,
113
113
"deepnote_url" : "https://deepnote.com/" ,
114
+ "basthon_url" : "https://notebook.basthon.fr/" ,
114
115
"notebook_interface" : "jupyterlab" ,
115
116
"thebe" : True ,
116
117
# "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 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 @@ -102,6 +102,7 @@ def add_launch_buttons(
102
102
jupyterhub_url = launch_buttons .get ("jupyterhub_url" , "" ).strip ("/" )
103
103
binderhub_url = launch_buttons .get ("binderhub_url" , "" ).strip ("/" )
104
104
colab_url = launch_buttons .get ("colab_url" , "" ).strip ("/" )
105
+ basthon_url = launch_buttons .get ("basthon_url" , "" ).strip ("/" )
105
106
deepnote_url = launch_buttons .get ("deepnote_url" , "" ).strip ("/" )
106
107
if binderhub_url :
107
108
url = (
@@ -161,6 +162,19 @@ def add_launch_buttons(
161
162
}
162
163
)
163
164
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
+
164
178
# Add thebe flag in context
165
179
if launch_buttons .get ("thebe" , False ):
166
180
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 56
56
</ span >
57
57
</ a >
58
58
</ 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 >
59
69
< li >
60
70
< button class ="headerbtn headerbtn-launch-thebe " data-placement ="left " data-toggle ="tooltip " onclick ="initThebeSBT() " title ="Launch Thebe ">
61
71
< span class ="headerbtn__icon-container ">
Original file line number Diff line number Diff line change 45
45
</ span >
46
46
</ a >
47
47
</ 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 >
48
58
< li >
49
59
< button class ="headerbtn headerbtn-launch-thebe " data-placement ="left " data-toggle ="tooltip " onclick ="initThebeSBT() " title ="Launch Thebe ">
50
60
< span class ="headerbtn__icon-container ">
You can’t perform that action at this time.
0 commit comments