Creating a table of contents for Xaringan
Inspired by slidy and reveal.js
By Lucio Cornejo in rmarkdown xaringan
May 31, 2022
The lack of a table of contents in Xaringan has actually been an open issue since 2019. Other html presentation formats in R Markdown, such as revealjs::revealjs_presentation and slidy_presentation do provide a table of contents, which allows for a faster navigation of the slides.
As Yihui explained in the issue page above, an implementation of a table of contents for Xaringan requires JavaScript knowledge. Therefore, I’ve implemented just that, respecting the properties explained by Yihui in this comment of his.