diff --git a/.hooks/pre-commit b/.hooks/pre-commit new file mode 100755 index 0000000000000000000000000000000000000000..82cb3a44115fbb9979a2ad611f061ec6df11b6ca --- /dev/null +++ b/.hooks/pre-commit @@ -0,0 +1,10 @@ +#!/bin/sh + +for U in "$(git diff --cached --name-only)"; do + # skip files staged for deletion + test -e "$U" || continue + if [[ "$U" =~ .ipynb$ ]]; then + jupyter nbconvert --debug --ClearOutputPreprocessor.enabled=True --inplace "$U" + fi + git add "$U" +done diff --git a/binder/requirements.txt b/binder/requirements.txt index 30912f8b7fbfe27137e19c1a749f78913636c2d1..785c8f9bb9f1efda1b07ea05a2d1b677f58f0c96 100644 --- a/binder/requirements.txt +++ b/binder/requirements.txt @@ -1,5 +1,6 @@ black isort +jupyter_contrib_nbextensions jupyterlab jupyterlab-code-formatter jupyterlab-execute-time