From 6eba6d40bec8ad100d154b6d55d667ebb4269828 Mon Sep 17 00:00:00 2001 From: Julian Pistorius Date: Fri, 23 Feb 2024 21:51:52 +0000 Subject: [PATCH] Use Binder with Quarto --- .jupyter/jupyter_notebook_config.py | 13 +++++ .jupyter/vscode.svg | 21 +++++++ apt.txt | 1 + postBuild | 90 +++++++++++++++++++++++++++++ 4 files changed, 125 insertions(+) create mode 100644 .jupyter/jupyter_notebook_config.py create mode 100644 .jupyter/vscode.svg create mode 100644 apt.txt create mode 100644 postBuild diff --git a/.jupyter/jupyter_notebook_config.py b/.jupyter/jupyter_notebook_config.py new file mode 100644 index 0000000..f0ba248 --- /dev/null +++ b/.jupyter/jupyter_notebook_config.py @@ -0,0 +1,13 @@ +# Traitlet configuration file for jupyter-notebook. + +c.ServerProxy.servers = { + 'vscode': { + 'command': ['code-server', '--auth', 'none', '--disable-telemetry', '--port={port}', '.'], + 'timeout': 300, + 'launcher_entry': { + 'enabled': True, + 'icon_path': '.jupyter/vscode.svg', + 'title': 'VS Code', + }, + }, +} diff --git a/.jupyter/vscode.svg b/.jupyter/vscode.svg new file mode 100644 index 0000000..376182b --- /dev/null +++ b/.jupyter/vscode.svg @@ -0,0 +1,21 @@ + + + logo + + + + + + + + + + + diff --git a/apt.txt b/apt.txt new file mode 100644 index 0000000..a18b53c --- /dev/null +++ b/apt.txt @@ -0,0 +1 @@ +zip \ No newline at end of file diff --git a/postBuild b/postBuild new file mode 100644 index 0000000..c900b46 --- /dev/null +++ b/postBuild @@ -0,0 +1,90 @@ +#!/bin/bash -v + +# determine which version of Quarto to install +QUARTO_VERSION=1.4.550 + +# See whether we need to lookup a Quarto version +if [ $QUARTO_VERSION = "prerelease" ]; then + QUARTO_JSON="_prerelease.json" +elif [ $QUARTO_VERSION = "release" ]; then + QUARTO_JSON="_download.json" +fi + +if [ $QUARTO_JSON != "" ]; then + +# create a python script and run it +PYTHON_SCRIPT=_quarto_version.py +if [ -e $PYTHON_SCRIPT ]; then + rm -rf $PYTHON_SCRIPT +fi + +cat > $PYTHON_SCRIPT <