You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example application or steps to reproduce the problem
Works:
---
title: "Hello, Tutorial!"
output: learnr::tutorial
runtime: shiny_prerendered
---
```{r setup, include=FALSE}
library(learnr)
```
This code computes the answer to one plus one,
change it so it computes two plus two:
```{r addition, exercise=TRUE}
1 + 1
```
Does not work:
---
title: "Hello, Tutorial!"
output: learnr::tutorial
runtime: shiny_prerendered
---
```{r}
#| label: setup
#| include: FALSE
library(learnr)
```
This code computes the answer to one plus one,
change it so it computes two plus two:
```{r}
#| label: addition
#| exercise: TRUE
1 + 1
```
Also does not work:
---
title: "Hello, Tutorial!"
output: learnr::tutorial
runtime: shiny_prerendered
---
```{r}
#| setup, include=FALSE
library(learnr)
```
This code computes the answer to one plus one,
change it so it computes two plus two:
```{r}
#| addition, exercise=TRUE
1 + 1
```
Describe the problem in detail
I generally use Quarto these days, and I'm afraid I've gotten a little too used to the hashpipe-style YAML chunk options it offers! 😅
When trying out the simple {learnr} demo, I noticed that it works great as is, but if I try to modify it to use hashpipe-style chunk options (using either the YAML syntax or the comma-separated one, {learnr} crashes as soon as a user-runnable code chunk is executed (which, depending on how the document is structured, is either on first run or when a code window's Run button is pushed).
The text was updated successfully, but these errors were encountered:
Thanks for the report @jimjam-slam! There's something unusual happening with knitr when #| label: addition is used instead of {r addition}. learnr's code could be more defensive against these differences (I'll have a PR up shortly) but I think it's also an inconsistency worth fixing in knitr (I'll file a bug report shortly as well).
For now, I'd recommend declaring the chunk label in the chunk header. This is working for me:
---title: "Hello, Tutorial!"output: learnr::tutorialruntime: shiny_prerendered---```{r}#| label: setup#| include: FALSElibrary(learnr)```
This code computes the answer to one plus one,
change it so it computes two plus two:
```{r}#| label: addition#| exercise: TRUE1 + 1```
System details
Output of
sessioninfo::session_info()()
:Example application or steps to reproduce the problem
Works:
Does not work:
Also does not work:
Describe the problem in detail
I generally use Quarto these days, and I'm afraid I've gotten a little too used to the hashpipe-style YAML chunk options it offers! 😅
When trying out the simple
{learnr}
demo, I noticed that it works great as is, but if I try to modify it to use hashpipe-style chunk options (using either the YAML syntax or the comma-separated one,{learnr}
crashes as soon as a user-runnable code chunk is executed (which, depending on how the document is structured, is either on first run or when a code window's Run button is pushed).The text was updated successfully, but these errors were encountered: