rstudio/bookdown-demo

custom js

jeroen opened this issue · 5 comments

Is there a standard way to add custom javascript to html output? Similar to style.css but then javascript?

yihui commented

Yes, you can use the includes option: https://bookdown.org/yihui/bookdown/yaml-options.html It is inherited from rmarkdown::html_document: http://rmarkdown.rstudio.com/html_document_format.html#includes

Thank you!

Perhaps add this to the demo?

yihui commented

I'm not sure. This demo is supposed to be a starting point, and it is probably not very common for beginners to add custom JS to the book.

OK that makes sense. It's difficult to these options though, if not by example.