pkg2HTML {tools} | R Documentation |
Rd Converters
Description
Generate a single-page HTML reference manual from the Rd sources contained in an installed or source R package.
Usage
pkg2HTML(package, dir = NULL, lib.loc = NULL,
outputEncoding = "UTF-8",
stylesheet = file.path(R.home("doc"), "html", "R-nav.css"),
hooks = list(pkg_href = function(pkg) sprintf("%s.html", pkg)),
texmath = getOption("help.htmlmath"),
prism = TRUE,
out = NULL,
toc_entry = c("title", "name"),
...,
Rhtml = FALSE,
mathjax_config = file.path(R.home("doc"), "html", "mathjax-config.js"),
include_description = TRUE)
Arguments
package |
typically a character string giving the name of an installed package. Can also be a file path or URL pointing to a source tarball (this feature is experimental). |
dir |
character string giving the path to a directory containing an installed or source package. |
lib.loc |
a character vector describing the location of R
library trees to search through, or |
outputEncoding |
character string; see |
stylesheet |
character string giving URL containing CSS style information. |
hooks |
A list of functions controlling details of
output. Currently the only component used is |
texmath |
character string controlling math rendering library to
be used, either |
prism |
logical flag controlling code highlighting, as described in
|
out |
a filename or connection object to which to write the
output. By default ( |
toc_entry |
Determines whether the entry for a help page in the table of contents is the name of the help page or its title. |
... |
additional arguments, passed on to
|
Rhtml |
logical: whether the output is intended to be a Rhtml
file that can be processed using knitr. If |
mathjax_config |
character string giving path of file containing
configuration instructions for MathJax. Relevant only if
|
include_description |
logical flag indicating whether the output
should begin with the contents of the |
Details
The pkg2HTML
function is intended to produce a single-page HTML
reference manual for a given package, with links to other
packages. The URLs of links to external packages are controlled by the
provided hooks.
The handling of \Sexpr
-s are necessarily incomplete, but can be
controlled to some extent by specifying the stages
argument. Best results are likely for installed packages.
Value
The name of the output file (invisibly).
Author(s)
Deepayan Sarkar
See Also
Examples
pkg2HTML("tools", out = tempfile(fileext = ".html")) |> browseURL()