Description Usage Arguments Details Examples
View source: R/autolink_html.R
The autolinker is built around two XPath expressions:
//pre[contains(@class, 'r')]:
this finds all <div>s with class sourceCode and r. The contents
must be syntax-highlighted using pygments.
(This is default in rmarkdown::html_document when theme = NULL.)
.//code[count(*) = 0]: this finds all <code> that contain only
text (and no other tags).
1 | autolink_html(input, output = input, local_packages = character())
|
input, output |
Input and output paths for HTML file |
local_packages |
A named character vector providing relative paths (value) to packages (name) that can be reached with relative links from the target HTML document. |
Currently the following expressions are linked:
Function calls, foo()
Function calls qualified with the package name, bar::foo()
Symbols qualified with the package name, bar::baz
Help calls, ?foo, package?foo, and ?bar::foo
Vignette calls, vignette(baz), vignette(baz, package = "bar")
Calls to library() and require() are used to find the topics connected
to unqualified references.
1 2 3 4 5 6 7 8 9 | ## Not run:
autolink_html("path/to/file.html",
local_packages = c(
shiny = "shiny",
shinydashboard = "shinydashboard"
)
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.