Hi, firstly thanks for this wonderful project.
I’m looking for a dummies guide for jupyter lab extensions configuration using python e.g. config.py
(for jupyter hub)
I’m using tljh. I would like to modify the tljh_custom_jupyterhub_config
plugin to creating settings for a jupyter lab extensions.
For example, take jupyterlab_execute_time
https://github.com/deshaw/jupyterlab-execute-time:
Following instructions (for local development) it says open jupyter lab and do Settings->Advanced Settings Editor->Notebook: {“recordTiming”: true}.
Instead of having all users on Jupyter Hub do this (myself included) I would like to add it to the Jupyter Hub config. What would this look like in python code. I would have a guess at something like
c.notebook-extension.recordTiming = True
but I have no way of knowing and couldn’t find examples in:
I think that you are looking for overrides.json
: Advanced Usage — JupyterLab 3.2.5 documentation
1 Like
Perfect. Thanks. That worked
) # sudo chown root:jupyterhub-users /srv/scratch
sh.chmod("777", "/srv/scratch") # sudo chmod 777 /srv/scratch
sh.chmod("g+s", "/srv/scratch") # sudo chmod g+s /srv/scratch
# Link skeleton directory (directory copied to a new user's home on log in)
sh.ln("-s", "/srv/scratch", "/etc/skel/scratch")
@hookimpl
def tljh_post_install():
# Configure Jupyter lab extensions
overrides_file = "/opt/tljh/user/share/jupyter/lab/settings/overrides.json"
overrides_path = Path(overrides_file)
overrides_path.parent.mkdir(exist_ok=True)
with overrides_path.open("w") as f:
print("{", file=f)
print(' "@jupyterlab/notebook-extension:tracker": {', file=f)
print(' "recordTiming": true', file=f)
print(" },", file=f)
print(' "@ryantam626/jupyterlab_code_formatter:settings": {', file=f)
print(' "formatOnSave": true', file=f)
print(" }", file=f)
1 Like