quarto-revealjs-codewindow icon indicating copy to clipboard operation
quarto-revealjs-codewindow copied to clipboard

codewindow drops block-level elements after the second block

Open gadenbuie opened this issue 2 years ago • 1 comments
trafficstars

If you try to put more than one thing, like two code blocks or additional text etc. into a codewindow, codewindow will silently drop the additional elements. An easy way around this (that clutters my source code a bit) is to wrap the second element in a fenced div,

Drops the second code block

::: {.codewindow .r}
my-script.R

```r
runif(1)
```

```r
runif(42)
```
:::

Keeps the second code block

::: {.codewindow .r}
my-script.R

::: {.contents}
```r
runif(1)
```

```r
runif(42)
```
:::
:::

gadenbuie avatar Sep 09 '23 18:09 gadenbuie

Although, maybe this would be a way to support multiple tabs as mentioned in #4:

:::: {.codewindow}
::: {.editor .r .active name="00-load.R"}
```r
read.csv("my-data.csv")
```
:::

::: {.editor .r name="01-clean.R"}
```r
library(tidyverse)
```
:::
::::

Looking at this now, maybe the airquotes in #4 were premature. You could probably build on fragments to "switch" focus between the tabs, e.g this syntax would start on the first tab and then focus the second tab on the next slide advancement:

:::: {.codewindow}
::: {.editor .r name="00-load.R"}
```r
read.csv("my-data.csv")
```
:::

::: {.editor .r .fragment name="01-clean.R"}
```r
library(tidyverse)
```
:::
::::

gadenbuie avatar Sep 09 '23 18:09 gadenbuie