I'm preparing a RMarkdown reveal.js presentation. I want the R Code sections in the slide to be foldable in nature.
My yaml header looks like this, but the code folding is not visible in the final presentation.
---
title: "Untitled"
output:
revealjs::revealjs_presentation:
code_folding: hide
---
## R Markdown
This is an R Markdown presentation. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document.
## Slide with R Code and Output
```{r}
summary(cars)
```
## Slide with Plot
```{r, echo=FALSE}
plot(cars)
```
Adding code_folding: hide
works for regular RMarkdown file.
Is code_folding not available for presentation? Is there any alternative way that I should try?