From 630b3b108c70cb47245802ff271317abc8911bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20BRIOL?= Date: Mon, 1 Jul 2024 19:28:43 +0200 Subject: [PATCH] feat: Update FES2022 documentation and binder configuration --- binder/postBuild | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 binder/postBuild diff --git a/binder/postBuild b/binder/postBuild new file mode 100644 index 0000000..b6faf9d --- /dev/null +++ b/binder/postBuild @@ -0,0 +1,29 @@ +set -e + +TMP_CONTENT_DIR=/tmp/pyfes +mkdir -p $TMP_CONTENT_DIR +cp -r examples binder $TMP_CONTENT_DIR +for item in $(find . -name "*.nc") +do + dirname=$(dirname $item) + mkdir -p $TMP_CONTENT_DIR/$dirname + cp $item $TMP_CONTENT_DIR/$item +done + +find . -delete + +GENERATED_NOTEBOOKS_DIR=.generated-notebooks +cp -r $TMP_CONTENT_DIR/examples $GENERATED_NOTEBOOKS_DIR + +find $GENERATED_NOTEBOOKS_DIR -name '*.py' -exec sphinx_gallery_py2jupyter '{}' + +NON_NOTEBOOKS=$(find $GENERATED_NOTEBOOKS_DIR -type f | grep -v -E '\.(ipynb|yml)') +rm -f $NON_NOTEBOOKS + +mv $TMP_CONTENT_DIR/binder . +mv $TMP_CONTENT_DIR/tests . +rm -rf $TMP_CONTENT_DIR + +mkdir -p notebooks +cp -v $GENERATED_NOTEBOOKS_DIR/*.ipynb notebooks/ +cp -v $GENERATED_NOTEBOOKS_DIR/*.yml notebooks/ +rm -rf $GENERATED_NOTEBOOKS_DIR