Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Of course, you can also use the env hook to set any other environment variables here that you might need.

IMPORTANT: note that changes to the env hook only take effect after you've restarted the Jupyter Notebook Server.

The script hook

The script hook is executed whenever you or a student starts a Jupyter Nobeook server. The default script hook takes care of synchronizing the JHL_notebooks folder. Again, we advise to leave the default lines untouched, but your are free to add additional commands that you would like to get  executed at startup. There are many possible uses, such as synchronizing additional folders, enabling notebook extensions, etc. A sample script might look like:

#!/bin/bash
## script run before the notebook is started
# can be used to install notebook extension ore serverextension

### Install the module notebook extension just an example
#
#jupyter nbextension enable --py jupyterlmod --user
jupyter nbextension enable --py widgetsnbextension --user
echo JHL_hooks/script executed

## No need to copy the notbook dir if we are the teacher
if [[ ${HOME} != ${TEACHER_DIR} ]]
then
rsync --archive --ignore-existing ${TEACHER_DIR}/JHL_notebooks/ ${HOME}/JHL_notebooks
fi

IMPORTANT: note that changes to the script hook only take effect after you've restarted the Jupyter Notebook Server.

Installing additional software

...