Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Binder with Quarto #7

Draft
wants to merge 9 commits into
base: quarto
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .binder/.jupyter/jupyter_notebook_config.py
Original file line number Diff line number Diff line change
@@ -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',
},
},
}
21 changes: 21 additions & 0 deletions .binder/.jupyter/vscode.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .binder/apt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zip
92 changes: 92 additions & 0 deletions .binder/postBuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/bin/bash -v

cp -R .binder/.jupyter .

# 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 <<EOF
import urllib, json

import urllib.request, json
with urllib.request.urlopen("https://quarto.org/docs/download/${QUARTO_JSON}") as url:
data = json.load(url)
print(data['version'])

EOF

QUARTO_VERSION=$(python $PYTHON_SCRIPT)
rm -rf $PYTHON_SCRIPT

fi


echo
echo Installing Quarto $QUARTO_VERSION
echo

# download and install the deb file
curl -LO https://github.com/quarto-dev/quarto-cli/releases/download/v$QUARTO_VERSION/quarto-$QUARTO_VERSION-linux-amd64.deb
dpkg -x quarto-$QUARTO_VERSION-linux-amd64.deb .quarto
rm -rf quarto-$QUARTO_VERSION-linux-amd64.deb

# get quarto in the path
mkdir -p ~/.local/bin
ln -s ~/.quarto/opt/quarto/bin/quarto ~/.local/bin/quarto

# create the proper pandoc symlink to enable visual editor in Quarto extension
ln -s ~/.quarto/opt/quarto/bin/tools/x86_64/pandoc ~/.quarto/opt/quarto/bin/tools/pandoc


echo
echo Installed Quarto
echo

echo
echo Configuring VSCode
echo
# download and install VS Code server
CODE_VERSION=4.16.1

# download and extract
wget -q -O code-server.tar.gz https://github.com/coder/code-server/releases/download/v$CODE_VERSION/code-server-$CODE_VERSION-linux-amd64.tar.gz
tar xzf code-server.tar.gz
rm -rf code-server.tar.gz

# place in hidden folder
mv "code-server-$CODE_VERSION-linux-amd64" .code-server

# get code-server in path
mkdir -p ./.local/bin
ln -s ~/.code-server/bin/code-server ~/.local/bin/code-server

# install vscode extensions
code-server --install-extension ms-python.python
code-server --install-extension sumneko.lua
code-server --install-extension quarto.quarto

echo
echo Configured VSCode
echo
# install required python packages
python3 -m pip install jupyter-server-proxy
python3 -m pip install jupyterlab-quarto==0.1.45

echo
echo Completed
echo
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Arizona Research Bazaar website

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/resbazaz/website-draft/quarto?urlpath=vscode)

### Technologies used:

- [Quarto](https://nodejs.org/)
Expand Down Expand Up @@ -67,10 +69,12 @@ TODO: document `_quarto.yml`

- Decide what to do with the blog

- Verify that new festival page links are still consistent
- Figure out redirects for old festival links

- Copy code of conduct md from organization repo as part of build?

- DONATE NOW button (stuff about our opencollective)

- Actually include full instructions for editing + adding things in the README

- Need to update the github build workflow to only run when pushing to main
2 changes: 2 additions & 0 deletions resbaz/Arizona2023.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: default
title: ResBaz Arizona
aliases:
- Arizona2023
---

<style>
Expand Down
2 changes: 2 additions & 0 deletions resbaz/resbazTucson2019.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: default
title: ResBaz Arizona
aliases:
- resbazTucson2019
---
## Workshop/Course Descriptions!!!
You can find them [here](https://docs.google.com/document/d/1BUXYq9KYHxaoHiU1F-dVTvXxKlqrcCs0NsEAMDCjzo8/edit?usp=sharing).
Expand Down
2 changes: 2 additions & 0 deletions resbaz/resbazTucson2020.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: default
title: ResBaz Arizona
aliases:
- resbazTucson2020
---
## Workshop/Course Descriptions

Expand Down
2 changes: 2 additions & 0 deletions resbaz/resbazTucson2021.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: default
title: ResBaz Arizona
aliases:
- resbazTucson2021
---

## What
Expand Down
2 changes: 2 additions & 0 deletions resbaz/resbazTucson2022.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: default
title: ResBaz Arizona
aliases:
- resbazTucson2022
---

<style>
Expand Down
8 changes: 8 additions & 0 deletions styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
height: 50vw;
text-align: center;
}

@media screen and (orientation: portrait) {
.quarto-title-banner {
height: 100vh;
text-align: center;
}
}

.quarto-title {
margin: auto;
}
Expand Down