rstudio/rmarkdown — pull request #182 by jmcphers (2014-07-22 16:30:15+00:00)
Title: fix #180: support cached ioslides presentations on Shiny Server

This change fixes a bug that exists when rendering static IOSlides presentations via `rmarkdown::run`.

The problem is that the `ioslides_presentation.lua` script is expected to be in the same directory as the destination file. This is the case when rendering uncached documents (`runtime = shiny`), but not the case when rendering cacheable documents: in that case the destination file is in `/tmp/rmarkdown`, but the intermediates are in `/tmp/[R session temp]`.

The fix:

1. Use another directory level in the cache--so instead of putting all cached docs in `/tmp/rmarkdown`, put them in `/tmp/rmarkdown/[cache key].`"
2. Use the document's destination folder as its intermediates directory. This will still be `tempdir()` for uncacheable (Shiny) content, but for cached content the intermediates directory will now be alongside the destination file.