I would like to place a hook in index.Rmd
of my bookdown
book and have it execute at the end of the knitting process.
# I tried
knitr::opts_hooks$set(document = {
session_info <- devtools::session_info()
save(session_info, file = "session_info.RData")
})
This code creates session_info
at the beginning of the knitting process, not at the end after all packages have been loaded and attached.