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

codewindow drops block-level elements after the second block #5

Open
gadenbuie opened this issue Sep 9, 2023 · 1 comment
Open

Comments

@gadenbuie
Copy link

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
Copy link
Author

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)
```
:::
::::

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant