From 2ae9bf3eb66517d6bfc5f7e34516e3782c720286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Tue, 30 Nov 2021 09:29:03 +0100 Subject: [PATCH] Properly open notebooks on Binder See https://github.com/mwouts/jupytext/issues/803. --- binder/labconfig/default_setting_overrides.json | 9 +++++++++ binder/postBuild | 6 ++++++ binder/requirements.txt | 3 ++- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 binder/labconfig/default_setting_overrides.json create mode 100644 binder/postBuild diff --git a/binder/labconfig/default_setting_overrides.json b/binder/labconfig/default_setting_overrides.json new file mode 100644 index 000000000..a38e65d52 --- /dev/null +++ b/binder/labconfig/default_setting_overrides.json @@ -0,0 +1,9 @@ +{ + "@jupyterlab/docmanager-extension:plugin": { + "defaultViewers": { + "markdown": "Jupytext Notebook", + "jupytext-md": "Jupytext Notebook" + } + } +} + diff --git a/binder/postBuild b/binder/postBuild new file mode 100644 index 000000000..34ef85fd8 --- /dev/null +++ b/binder/postBuild @@ -0,0 +1,6 @@ +# Stop everything if one command fails +set -e + +# See https://github.com/mwouts/jupytext/issues/803#issuecomment-982170660 +mkdir -p ${HOME}/.jupyter/labconfig +cp binder/labconfig/* ${HOME}/.jupyter/labconfig diff --git a/binder/requirements.txt b/binder/requirements.txt index 66408a21b..869d2b29b 100644 --- a/binder/requirements.txt +++ b/binder/requirements.txt @@ -1,3 +1,4 @@ # For application deployments, like Binder git+https://github.com/poliastro/poliastro.git#egg=poliastro -jupytext + +jupytext>=1.13.2 # https://github.com/mwouts/jupytext/issues/271