maxheld83 / pensieve

R package for the scientific study of human subjectivity.
https://www.maxheld.de/pensieve
GNU Affero General Public License v3.0
11 stars 2 forks source link

use earlier rendered item assets in knitted documents #416

Open maxheld83 opened 6 years ago

maxheld83 commented 6 years ago

Right now, the only way to get rendered intems into knitted documents is via plot::() which will send items all the way through the conversion chain, even though earlier steps (say, pdf, or svg) would suffice.

A better way cannot be achieved within plot (because it must respect rescaling etc.), but might be possible by using knit_print() to (optionally) write out some knitr::include_graphics() call on the respective items. The problem with this is dealing with the file system. knit_print() however appears to support some kind of meta data, which might include dealing with files.

For HTML output, this could also just be an HTML widget, which, happily, does include facilities for assets.