View source: R/add_script_to_rmd.R
add_script_to_rmd | R Documentation |
This function adds custom CSS and JavaScript code to an R Markdown document. The function reads CSS and JavaScript code from specific files (e.g., 'button.css' and 'button.js') located in the "esmtools" package. It then creates appropriate HTML elements to include the code within the R Markdown document. This function is automatically called when importing the esmtools package and rendering the rmarkdown package.
add_script_to_rmd()
Returns an text object marked as HTML containing the combined CSS and JavaScript code stored within the inst folder of the package.
if (interactive()) {
add_script_to_rmd()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.