derek-thomas
commited on
Commit
·
8bccfc1
1
Parent(s):
5ca05cc
Trying to add startup popup
Browse files- jupyterlab/00-startup.py +19 -0
- jupyterlab/on_startup.sh +3 -0
jupyterlab/00-startup.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from IPython.display import display, Javascript
|
| 2 |
+
|
| 3 |
+
def show_popup():
|
| 4 |
+
display(Javascript("""
|
| 5 |
+
require(
|
| 6 |
+
['base/js/dialog'],
|
| 7 |
+
function(dialog) {
|
| 8 |
+
dialog.modal({
|
| 9 |
+
title: 'Welcome',
|
| 10 |
+
body: 'Popup place-holder',
|
| 11 |
+
buttons: {
|
| 12 |
+
'Ok': {}
|
| 13 |
+
}
|
| 14 |
+
});
|
| 15 |
+
}
|
| 16 |
+
);
|
| 17 |
+
"""))
|
| 18 |
+
|
| 19 |
+
show_popup()
|
jupyterlab/on_startup.sh
CHANGED
|
@@ -21,4 +21,7 @@ rm -rf /tmp/tgi-benchmark-notebooks
|
|
| 21 |
mkdir -p ~/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/ && \
|
| 22 |
echo '{ "theme":"JupyterLab Dark" }' > themes.jupyterlab-settings
|
| 23 |
|
|
|
|
|
|
|
|
|
|
| 24 |
echo "All right on the HF site"
|
|
|
|
| 21 |
mkdir -p ~/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/ && \
|
| 22 |
echo '{ "theme":"JupyterLab Dark" }' > themes.jupyterlab-settings
|
| 23 |
|
| 24 |
+
# Move Startup script
|
| 25 |
+
mv ~/app/00-startup.py ~/.ipython/profile_default/startup/
|
| 26 |
+
|
| 27 |
echo "All right on the HF site"
|