I am trying to find a way to get a "retractable" TOC of my rnotebook as a left sidebar (by this I mean the TOC should totally disappear).
The idea being that the basic TOC takes too much room on the left side of my document.
I found an example for instance here or the amazing toc2 from jupyter extensions
Is there anything that already exists or how can I use something else (like the one I linked to above)
Here is a tiny example (for example purposes as it is not what I want) that uses a "static" TOC, I would like a way to make the TOC "retractable"
---
title: "Example"
author: you
output:
html_notebook:
toc: true
toc_depth: 3
toc_float:
collapsed: true
smooth_scroll: true
---
# Title
## Sub title
```{r}
library(data.table)
library(ggplot2)
set.seed(1L)
data <- data.table(x = -5:4, y = -5:4 + runif(10))
ggplot(data, aes(x, y)) + geom_line() + geom_point()
```