Skip to content

Commit

Permalink
Merge pull request #19 from UBC-MDS/202425-ch6
Browse files Browse the repository at this point in the history
render jupyter rise slides and embed in book; ignore html in slides dir
  • Loading branch information
chendaniely authored Sep 18, 2024
2 parents ec35001 + b76f833 commit 17ec212
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
45 changes: 30 additions & 15 deletions lectures/6-rmarkdown-quarto-slides-ghpages.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,6 @@ title: 'Quarto, RMarkdown, and Jupyter Slides'
::::
:::

## tl;dr -- dan is still working on this chapter

but here are the rough commands for folks who are ahead:

```r
install.packages(c('xaringan', 'revealjs'))
```

Create a new R Markdown document > Templates >

pick either a xaringan template or revealjs presentation template

for xaringan, you might need to install extra packages to render.


## Quarto Documents

[Quarto](https://quarto.org/)
Expand Down Expand Up @@ -134,6 +119,26 @@ format: revealjs

{{< revealjs "demos/slides/slides-quarto.html" height="600px" class="ratio ratio-16x9" >}}

If you want to create your `revealjs` html slides and be able to share
a **single** html file with others as a slide,
you may need to embed and make the slide "self contained".

```yaml
format:
revealjs:
embed-resources: true
```

This puts all the external resources for the HTML document inside the HTML file.
Otherwise your slides would need to travel in a zip file
with all the external resources in the same directory.
You will typically need this when sharing slides that have images
and computation in them.
You may notice additional folders created in the directory as a cue
that you may need to think about embedding your resources to make
the slides self-contained, depending on how you will use and share them.


### R Markdown

Expand Down Expand Up @@ -227,6 +232,16 @@ there is a small button on the top.

![](img/jupyter-rise-launch.png)

```{r}
#| include: false
system(
"jupyter nbconvert slides-rise.ipynb --to slides"
)
```

{{< revealjs "demos/slides/slides-rise.slides.html" height="600px" class="ratio ratio-16x9" >}}


## Putting it all together

Here's an example of a workshop given by the MDS teaching team at the
Expand Down
1 change: 1 addition & 0 deletions lectures/demos/slides/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ jupyter
numpy
matplotlib

# render rise slides
jupyterlab_rise

# supplemental to help run the course
jupyterlab

Expand Down

0 comments on commit 17ec212

Please sign in to comment.