Hoping someone can help - when rendering in quarto to HTML (and presumably same in Rmarkdown) often I wish to render the document without any evidence of the setup code chunks (like loading the libraries, loading data, data manipulation etc.) although you can hide the output with echo=false or include=false you still get the heading in the rendered HTML with nothing below. I still want to keep the headings in rstudio as they are so useful in the "outline" section of rstudio for quickly jumping between sections. Quick reprex below although the formatting for the YAML doesn't come through. Screenshots included of the rendered HTML and the "Outline" section in rstudio that I am trying to preserve. Many thanks
---
title: "test"
format: html
editor: visual
editor_options:
chunk_output_type: console
---
# "Setup" - I want this label hidden in my output
```{r echo=FALSE}
library(tidyverse)
```
# "Graph" - I want to keep this label in my output
```{r}
mtcars %>%
ggplot(aes(cyl, mpg)) +
geom_point()
```
Add the class .hidden just after the headings that you want to hide in the output.
document.qmd
---
title: "test"
format: html
editor: visual
editor_options:
chunk_output_type: console
---
# Setup {.hidden}
```{r echo=FALSE}
library(tidyverse)
```
# Graph
```{r}
mtcars %>%
ggplot(aes(cyl, mpg)) +
geom_point()
```