I’m using RMarkdown’s code-folding to hide code in an HTML document with this in the YAML header:
---
output:
html_document:
code_folding: hide
---
But in the rendered document it’s impossible to know what each chunk is doing without unfolding it, or putting a text description before/after it.
Is there a way to change the appearance of a folded chunk so it displays the chunk label (or a short description) of each chunk next to the “Show” button, preferably in a way that distinguishes it from regular markdown text? Ideally I’m hoping to have a chunk like this:
#| fold-label: "Import and cleanup data"
#| warning: FALSE
library(tidyverse)
mydata <- read.csv("path/mydata.csv", headers = T)
mydata <- mydata %>%
mutate(cleaned = T)
Look like this when folded (but keeping the Show button):
# Import and cleanup data