set_extension.RdAdd the class name before the extension of knitr images
set_extension(options, prefix = ".", suffix = ".", sep = ".")
| options | List. Options as passed by |
|---|---|
| prefix | Character. See |
| suffix | Character. See |
| sep | Character. See |
Options to be passed back to knitr.
When class.output is set, this function can add that class
before the file extension. From there, pre-process.js picks it up
by regex and adds the class to the plot.
set_extension handles multiple classes separated by spaces.
Periods are stripped out and spaces are replaced with sep.
The full filename looks like this:
(filepath)/(filename).(prefix)(classes)(suffix).(extension)
pre-process.js watches for this pattern, but set_extension
offers parameters to override them.
# NOT RUN { knitr::opts_hooks$set( class.output = surprisinglytidy::set_extension, dev = surprisinglytidy::set_extension ) # }