|
| 1 | +% File src/library/tools/man/pkg2HTML.Rd |
| 2 | +% Part of the R package, https://www.R-project.org |
| 3 | +% Copyright 2024 R Core Team |
| 4 | +% Distributed under GPL 2 or later |
| 5 | + |
| 6 | +\name{pkg2HTML} |
| 7 | +\alias{pkg2HTML} |
| 8 | +\title{ Rd Converters } |
| 9 | +\description{ |
| 10 | + Generate a single-page HTML reference manual from the Rd sources |
| 11 | + contained in an installed or source R package. |
| 12 | +} |
| 13 | +\usage{ |
| 14 | +pkg2HTML(package, dir = NULL, lib.loc = NULL, |
| 15 | + outputEncoding = "UTF-8", |
| 16 | + stylesheet = R.home("doc/html/R-nav.css"), |
| 17 | + hooks = list(pkg_href = function(pkg) sprintf("\%s.html", pkg)), |
| 18 | + texmath = getOption("help.htmlmath"), |
| 19 | + prism = TRUE, |
| 20 | + out = NULL, |
| 21 | + ..., |
| 22 | + Rhtml = FALSE, |
| 23 | + include_description = TRUE) |
| 24 | +} |
| 25 | +\arguments{ |
| 26 | + |
| 27 | + \item{package}{ character string giving either the name of an |
| 28 | + installed package, or a file path or URL pointing to a source tarball. |
| 29 | + } |
| 30 | + \item{dir}{ character string giving the path to a directory containing |
| 31 | + an installed or source package. |
| 32 | + } |
| 33 | + |
| 34 | + \item{lib.loc}{a character vector describing the location of \R |
| 35 | + library trees to search through, or \code{NULL}. Passed on to |
| 36 | + \code{\link{find.package}} and \code{\link{Rd_db}}. |
| 37 | + } |
| 38 | + \item{outputEncoding}{ character string; see \code{\link{Rd2HTML}}. } |
| 39 | + \item{stylesheet}{ character string giving URL containing CSS style |
| 40 | + information. |
| 41 | + } |
| 42 | + \item{hooks}{A list of functions controlling details of |
| 43 | + output. Currently the only component used is \code{pkg_href}, which |
| 44 | + is used to determine the output HTML file path given a package name |
| 45 | + as input. |
| 46 | + } |
| 47 | + \item{texmath, prism}{ logical flags, passed on to |
| 48 | + \code{\link{Rd2HTML}}. |
| 49 | + } |
| 50 | + \item{out}{a filename or connection object to which to write the |
| 51 | + output. The default \code{out = ""} is equivalent to |
| 52 | + \code{out = \link{stdout}()}.} |
| 53 | + \item{...}{additional arguments, passed on to |
| 54 | + \code{\link{Rd2HTML}}. The \code{stages} argument, if specified, is |
| 55 | + passed on to \code{\link{Rd_db}}. |
| 56 | + } |
| 57 | + \item{Rhtml}{logical: whether the output is intended to be a \I{Rhtml} |
| 58 | + file that can be processed using \CRANpkg{knitr}. If \code{TRUE}, the |
| 59 | + examples section is wrapped inside a \code{rcode} block. |
| 60 | + } |
| 61 | + \item{include_description}{ logical flag indicating whether the output |
| 62 | + should begin with the contents of the \code{DESCRIPTION} file. |
| 63 | + } |
| 64 | +} |
| 65 | + |
| 66 | +\details{ |
| 67 | + The \code{pkg2HTML} function is intended to produce a single-page HTML |
| 68 | + reference manual for a given package, with links to other |
| 69 | + packages. The URLs of links to external packages are controlled by the |
| 70 | + provided hooks. |
| 71 | + |
| 72 | + The handling of \verb{\Sexpr}-s are necessarily incomplete, but can be |
| 73 | + controlled to some extent by specifying the \code{stages} |
| 74 | + argument. Best results are likely for installed packages. |
| 75 | +} |
| 76 | + |
| 77 | +\value{ |
| 78 | + The name of the output file(invisibly). |
| 79 | +} |
| 80 | +\author{ |
| 81 | + Deepayan Sarkar |
| 82 | +} |
| 83 | +\seealso{ |
| 84 | + \code{\link{parse_Rd}}, \code{\link{Rd_db}}, |
| 85 | + \code{\link{Rd2HTML}}. |
| 86 | +} |
| 87 | +\examples{ |
| 88 | +\donttest{ |
| 89 | +pkg2HTML("tools", out = tempfile(fileext = ".html")) |> browseURL() |
| 90 | +} |
| 91 | +} |
| 92 | +\keyword{ documentation } |
0 commit comments