diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..31ec5ee --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,40 @@ +on: + push: + branches: + - main + +name: Render and Publish +jobs: + build-deploy: + runs-on: ubuntu-latest + permissions: + contents: write + pages: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Check out repository + uses: actions/checkout@v4 + - name: Setup NodeJS + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Set up Quarto + uses: quarto-dev/quarto-actions/setup@v2 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Install Jupyter + run: python3 -m pip install jupyter + - name: Setup R + uses: r-lib/actions/setup-r@v2 + - name: Install R packages + run: Rscript -e 'install.packages(c("rmarkdown", "knitr"))' + - name: Render Quarto Project + uses: quarto-dev/quarto-actions/publish@v2 + with: + target: gh-pages diff --git a/.gitignore b/.gitignore index 8426b8b..95e80d8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ node_modules example.html example_files +example_site + +/.quarto/ diff --git a/README.md b/README.md index c8c497b..1327fc5 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,21 @@ Have you ever given a talk or presentation and wanted an R or Python console *right there* in your slides for some quick throwaway examples or demos? Do you find switching to another window or desktop so that you can show some work in an IDE fiddly and distracting? -Then this plugin is for you. With Quarto Drop, you can press a shortcut key to immediately drop down from the top of the slide an interactive R or Python console, editor and plotting window. The same shortcut key then dismisses the console. +If so, this plugin is for you! With Quarto Drop, you can press a shortcut key to immediately drop down from the top of the slide an interactive R or Python console, editor and plotting window. The same shortcut key then dismisses the console. Show your demo then dismiss the console. Later, on another slide, you can drop it down again and state is maintained over multiple slides. + Code execution is powered by WebAssembly, using [webR](https://docs.r-wasm.org) and [Pyodide](https://pyodide.org). No R or Python execution servers are required. +## Demo + +Demo slides: https://r-wasm.github.io/quarto-drop/ + +## Screenshot + +![](https://github.com/r-wasm/quarto-drop/drop.gif) + ## Usage 1. Install the Quarto Drop extension: diff --git a/_quarto.yml b/_quarto.yml new file mode 100644 index 0000000..42ea2ca --- /dev/null +++ b/_quarto.yml @@ -0,0 +1,5 @@ +project: + type: website + render: + - example.qmd + output-dir: example_site diff --git a/images/drop.gif b/images/drop.gif new file mode 100644 index 0000000..58ce0ec Binary files /dev/null and b/images/drop.gif differ