Hi,
I am developing a package that uses some js code in a RMarkdown document, or more precisely, in the html output of it. My problem is that I don't know how to ingest the javascript through a package function...
What I mean by that is the following: for a Shiny app, I can do it via a function like:
ingest_dependency <- function(){
scripts_list <- c("js/script.js")
htmltools::htmlDependency(
name = "mypackage",
version = utils::packageVersion("mypackage"),
package = "mypackage",
src = ".",
script = scripts_list
)
}
Then it is enough to call it from the ui and inst/js/script.js from the package is available. How can I do something similar in js (using a package function)?