Skip to content

Commit 86caf47

Browse files
committed
Generate html manuals in extractManuals
1 parent 8aa6daf commit 86caf47

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

R/repository.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ extractManuals <- function(reposRoot, srcContrib, destDir) {
7777
buildManualsFromTarball <- function(tarball, unpackDir=".") {
7878
## helper function to unpack pdf & Rd files from the vig
7979
status <- TRUE
80-
cleanUnpackDir(tarball, unpackDir, "man", ".*\\.(pdf|Rd|rd)$")
80+
cleanUnpackDir(tarball, unpackDir, "man", ".*\\.(html|pdf|Rd|rd)$")
8181
ret <- unpack(tarball, unpackDir, "'*/man/*.[Rr]d'")
8282
if (ret != 0) {
8383
warning("non-zero exit status ", ret, " extracting man pages: ",
@@ -87,11 +87,16 @@ extractManuals <- function(reposRoot, srcContrib, destDir) {
8787
pkg <- pkgName(tarball)
8888
pkgDir <- file.path(unpackDir, pkg, "man")
8989
RCmd <- file.path(Sys.getenv("R_HOME"), "bin", "R")
90+
## create pdf
9091
Rd2pdfCmd <- paste0(
9192
RCmd, " CMD Rd2pdf --no-preview ",
9293
"--output=", pkgDir, "/", pkg, ".pdf ",
9394
"--title=", pkg, " ", pkgDir, "/*.[Rr]d")
9495
ret <- system(Rd2pdfCmd)
96+
## create html
97+
hooks <- list(pkg_href = function(pkg) sprintf("../../%s/man/%s.html", pkg, pkg))
98+
tools::pkg2html(dir = pkgDir, out = paste0(pkgDir, "/", pkg, ".html"),
99+
hooks = hooks)
95100
cleanUnpackDir(tarball, unpackDir, "man", ".*\\.(Rd|rd)$")
96101
if (ret != 0) {
97102
warning("non-zero exit status ", ret, " building ref man: ", pkg)

0 commit comments

Comments
 (0)