Description Usage Arguments Details Value Examples
Add the class name before the extension of knitr
images
1 | set_extension(options, prefix = ".", suffix = ".", sep = ".")
|
options |
List. Options as passed by |
prefix |
Character. See |
suffix |
Character. See |
sep |
Character. See |
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.
Options to be passed back to knitr
.
1 2 3 4 5 6 7 | ## Not run:
knitr::opts_hooks$set(
class.output = surprisinglytidy::set_extension,
dev = surprisinglytidy::set_extension
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.