diff --git a/jupyterlab_config.json b/.binder/overrides.json similarity index 100% rename from jupyterlab_config.json rename to .binder/overrides.json diff --git a/.binder/postBuild b/.binder/postBuild new file mode 100755 index 0000000..c995aa1 --- /dev/null +++ b/.binder/postBuild @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -eux + +mkdir -p ${NB_PYTHON_PREFIX}/share/jupyter/lab/settings +cp .binder/overrides.json ${NB_PYTHON_PREFIX}/share/jupyter/lab/settings/overrides.json diff --git a/.binder/requirements.txt b/.binder/requirements.txt new file mode 100644 index 0000000..3c8d7e7 --- /dev/null +++ b/.binder/requirements.txt @@ -0,0 +1 @@ +-r ../requirements.txt diff --git a/conf.py b/conf.py index 58652c2..bcb13b2 100644 --- a/conf.py +++ b/conf.py @@ -53,4 +53,7 @@ "use_repository_button": True, "use_issues_button": True, "use_edit_page_button": True, + "launch_buttons": { + "binderhub_url": "https://mybinder.org" + }, } diff --git a/pixi.toml b/pixi.toml index c83a7bb..b188d78 100644 --- a/pixi.toml +++ b/pixi.toml @@ -26,7 +26,10 @@ start = "jupyter lab" test = "bash ./test.sh" [activation] -scripts = ["setup_jupyterlab_config.sh"] +# Workaround overrides JupyterLab configuration (at the environment level) to +# make double-clicking on a Jupytext Markdown file open that file as a +# notebook. This is important for the development workflow for contributors. +scripts = ["bash .binder/postBuild"] [dependencies] python = ">=3.11" diff --git a/requirements.txt b/requirements.txt index a1e6cc1..6c58584 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,3 +11,4 @@ pytest nbval pytest-custom_exit_code jupytext +jupyterlab-myst diff --git a/setup_jupyterlab_config.sh b/setup_jupyterlab_config.sh deleted file mode 100644 index a721234..0000000 --- a/setup_jupyterlab_config.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -set -eux - -mkdir -p ${CONDA_PREFIX}/share/jupyter/lab/settings -cp jupyterlab_config.json ${CONDA_PREFIX}/share/jupyter/lab/settings/overrides.json