Skip to content

Commit 56e6c74

Browse files
author
hornik
committed
Also validate pkg2HTML() output in the HTML refman check.
git-svn-id: https://svn.r-project.org/R/trunk@89011 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 44dc8f4 commit 56e6c74

File tree

1 file changed

+37
-8
lines changed

1 file changed

+37
-8
lines changed

src/library/tools/R/check.R

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5567,21 +5567,50 @@ add_dummies <- function(dir, Log)
55675567
.libPaths(c(libdir, libpaths))
55685568
on.exit(.libPaths(libpaths), add = TRUE)
55695569
}
5570-
results1 <- lapply(db,
5571-
function(x)
5572-
tryCatch({
5573-
Rd2HTML(x, out, concordance = TRUE)
5574-
tidy_validate(out, tidy = Tidy)
5575-
},
5576-
error = identity))
5570+
## Nowadays we really need to validate the results of
5571+
## creating the package HTML refmans via pkg2HTML(),
5572+
## which may find additional problems (e.g., duplicated
5573+
## anchors). Not sure whether we also want to validate
5574+
## the Rd2HTML() outputs for the individual Rd files.
5575+
results1a <-
5576+
lapply(db,
5577+
function(x)
5578+
tryCatch({
5579+
Rd2HTML(x, out, concordance = TRUE)
5580+
tidy_validate(out, tidy = Tidy)
5581+
},
5582+
error = identity))
5583+
results1b <-
5584+
tryCatch({
5585+
stages <- c("build", "later", "install",
5586+
"render")
5587+
if(installed) {
5588+
pkg2HTML(basename(dir),
5589+
lib.loc = dirname(dir),
5590+
out = out, stages = stages,
5591+
concordance = TRUE)
5592+
} else {
5593+
pkg2HTML(dir = dir,
5594+
out = out, stages = stages,
5595+
concordance = TRUE)
5596+
}
5597+
tidy_validate(out, tidy = Tidy)
5598+
},
5599+
error = identity)
5600+
results1 <- c(results1a, list(results1b))
5601+
55775602
ignore <-
55785603
Sys.getenv("_R_CHECK_RD_VALIDATE_RD2HTML_IGNORE_EMPTY_SPANS_",
55795604
"true")
55805605
ignore <- if(config_val_to_logical(ignore))
55815606
"Warning: trimming empty <span>"
55825607
else
55835608
character()
5584-
results1 <- tidy_validate_db(results1, names(db), ignore)
5609+
results1 <- tidy_validate_db(results1,
5610+
c(names(db),
5611+
paste0(basename(dir),
5612+
".html")),
5613+
ignore)
55855614
}
55865615
}
55875616

0 commit comments

Comments
 (0)