Rev 88454 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/tools/man/pkg2HTML.Rd% Part of the R package, https://www.R-project.org% Copyright 2024 R Core Team% Distributed under GPL 2 or later\name{pkg2HTML}\alias{pkg2HTML}\title{ Rd Converters }\description{Generate a single-page HTML reference manual from the Rd sourcescontained 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("name", "title"),...,Rhtml = FALSE,mathjax_config = file.path(R.home("doc"), "html", "mathjax-config.js"),include_description = TRUE,concordance = FALSE)}\arguments{\item{package}{ typically a character string giving the name of aninstalled package. Can also be a file path or URL pointing to a sourcetarball (this feature is experimental).}\item{dir}{ character string giving the path to a directory containingan installed or source package.}\item{lib.loc}{a character vector describing the location of \Rlibrary trees to search through, or \code{NULL}. Passed on to\code{\link{find.package}} and \code{\link{Rd_db}}.}\item{outputEncoding}{ character string; see \code{\link{Rd2HTML}}. }\item{stylesheet}{ character string giving URL containing CSS styleinformation.}\item{hooks}{A list of functions controlling details ofoutput. Currently the only component used is \code{pkg_href}, whichis used to determine the output HTML file path given a package nameas input.}\item{texmath}{ character string controlling math rendering library tobe used, either \code{"katex"} or \code{"mathjax"}. The default isto use \code{"katex"}, unless the package appears to use the\code{\link[mathjaxr]{mathjaxr}} package in at least one of itsdocumentation files. The support for \I{MathJax} is experimental and maynot work well.}\item{prism}{ logical flag controlling code highlighting, as described in\code{\link{Rd2HTML}}.}\item{out}{a filename or connection object to which to write theoutput. By default (\code{NULL}), the filename is inferred from\code{hooks$pkg_href}, which defaults to \file{\var{pkg}.html}.}\item{toc_entry}{ Determines whether the entry for a help page in thetable of contents is the name of the help page or its title. }\item{...}{additional arguments, passed on to\code{\link{Rd2HTML}}. The \code{stages} argument, if specified, ispassed on to \code{\link{Rd_db}}.}\item{Rhtml}{logical: whether the output is intended to be a \I{Rhtml}file that can be processed using \CRANpkg{knitr}. If \code{TRUE}, theexamples section is wrapped inside a \code{rcode} block.}\item{mathjax_config}{ character string giving path of file containingconfiguration instructions for \I{MathJax}. Relevant only if\code{texmath = "mathjax"}.}\item{include_description}{ logical flag indicating whether the outputshould begin with the contents of the \code{DESCRIPTION} file.}\item{concordance}{ logical flag indicating whether the outputshould contain concordance information.}}\details{The \code{pkg2HTML} function is intended to produce a single-page HTMLreference manual for a given package, with links to otherpackages. The URLs of links to external packages are controlled by theprovided hooks.The handling of \verb{\Sexpr}-s are necessarily incomplete, but can becontrolled to some extent by specifying the \code{stages}argument. Best results are likely for installed packages.}\value{The name of the output file (invisibly).}\author{Deepayan Sarkar}\seealso{\code{\link{parse_Rd}}, \code{\link{Rd_db}},\code{\link{Rd2HTML}}.}\examples{\donttest{pkg2HTML("tools", out = tempfile(fileext = ".html")) |> browseURL()}}\keyword{ documentation }