Knitr options for case studies

Following up on:

Right now all of the case studies are fairly large because they are entirely self contained html files. If they are built as not self contained they would load faster since jquery can be loaded from a CDN, would only needed to be loaded once, and probably already cached for most users and images can be loaded in parallel in multiple queries. It currently takes about 4 seconds to load and render a single case study, which is very slow for a static page. It’s probably not too important, but if you are interested in best practices it might be worth keeping in mind.

I was looking for the original Rmd to regenerate these and make a pull request, but couldn’t find them. I was going to make a directory for each case study that has the main .html and the generated extra images, and a pdf version for offline viewing. The switch to non self-contained html can be done by adding this to the beginning of the R markdown file.

output:
  self_contained: false

This can also be done be setting
self_contained=FALSE in the call to rmarkdown::html_document

We decided before to take the hit on loading and rendering time in exchange for the simplicitly of having a single file.

If someone wants to move to doing multiple files, they’d have to regenerate all the static HTML and images from the .Rmd and then rearrange the directories on the web server in order to put each case study in its own directory.

The original .Rmd files are in the linked repos.

Thanks for the suggestions. I just submitted a pull request for this.

https://github.com/stan-dev/stan-dev.github.io/pull/44