How can I run all chunks *across all documents* in a bookdown project?



I sometimes like to run all chunks across all files of some rmarkdown project (here: bookdown, but I guess other multi-*.rmd-projects are similar), so I can inspect the objects in my Global Environment as they would be created when the project gets rendered.

For individual *.rmd this is implemented in RStudio; I can just click "Run All".

But when there are several (a lot) of files, this gets cumbersome and error-prone quickly. I also feel a little stupid because (when using bookdown) the .bookdown.yml already specifies order and inclusion of files.

I'm probably being very dense, but I can't figure out an easy way to do this.

(I'm aware that I could knitr::purl() my way to this result, but then I'd have to manually supply all the filenames in order and source the resulting file).


Did you ever get any feedback on this question? I'm looking for a knitr::purl()-like way for extracting source code from a bookdown project into a single R script to be used for interactive learning.


I don't believe I did, no. Just worked around it.


I'm considering opening an issue on the GitHub repo. Haven't seen one similar to this there. Have you asked this question on SO before? If not, I may go there first.


hehe, no, I also didn't SO this, because I couldn't think of a clear reprex.
I also wondered about a gh issue earlier today. Which repo should it go to? RStudio IDE or knitr?

Let's report back here about our progress; will +1 your issue.