Skip to content

Instantly share code, notes, and snippets.

@zgulde
Last active June 3, 2019 19:02
Show Gist options
  • Save zgulde/623a913888694946724b77d0976e5458 to your computer and use it in GitHub Desktop.
Save zgulde/623a913888694946724b77d0976e5458 to your computer and use it in GitHub Desktop.
JUPYTER_NOTEBOOK_CONFIG_FILE=$(jupyter --config-dir)/jupyter_notebook_config.py
# conda -c conda-forge install jupytext
python3 -m pip install --upgrade jupytext
[[ -f $JUPYTER_NOTEBOOK_CONFIG_FILE ]] || jupyter notebook --generate-config
if ! grep -q 'c.NotebookApp.contents_manager_class = "jupytext.TextFileContentsManager"' $JUPYTER_NOTEBOOK_CONFIG_FILE ; then
echo "# Added by $0 at $(date)" >> $JUPYTER_NOTEBOOK_CONFIG_FILE
echo 'c.NotebookApp.contents_manager_class = "jupytext.TextFileContentsManager"' >> $JUPYTER_NOTEBOOK_CONFIG_FILE
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment