Skip to content

Commit

Permalink
Add Python/Pyodide example
Browse files Browse the repository at this point in the history
  • Loading branch information
georgestagg committed Jul 23, 2024
1 parent bc844b5 commit 028c487
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ revealjs-plugins:

![](https://github.com/r-wasm/quarto-drop/raw/main/images/drop.gif)

Example slides: https://r-wasm.github.io/quarto-drop/
Example slides:
* R: https://r-wasm.github.io/quarto-drop/example.html
* Python: https://r-wasm.github.io/quarto-drop/example-python.html

## Configuration

Expand Down
1 change: 1 addition & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ project:
type: website
render:
- example.qmd
- example-python.qmd
output-dir: example_site
65 changes: 65 additions & 0 deletions example-python.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
title: "Quarto Drop plugin for Reveal.js"
subtitle: "A dropdown R or Python console"
format:
revealjs:
drop:
engine: pyodide
revealjs-plugins:
- drop
---

## Quarto Drop plugin for Reveal.js

Throughout this presentation, an interactive R console and editor can be invoked by pressing the drop shortcut

By default, the drop shortcut is the backtick key: [`]{style="background-color: #EEE; border: 1px solid #333; border-radius: 5px; padding: 0px 8px"}

. . .

</br>

Alternatively, click the console button in the bottom left of the slide

## Configuration

Set the drop shortcut and button visibility in the `yaml` header.

```yaml
---
format:
revealjs:
drop:
button: false
shortcut: "]"
---
```

## Execution Engine

For a Python console, set the `pyodide` engine in the `yaml` header.

```yaml
---
format:
revealjs:
drop:
engine: pyodide
---
```

## Default packages

Automatically download packages when the presentation starts

```yaml
---
format:
revealjs:
drop:
engine: pyodide
pyodide:
packages:
- matplotlib
---
```

0 comments on commit 028c487

Please sign in to comment.