Skip to content

Commit b6506d4

Browse files
author
smeyer
committed
fix vignette links in doc/index.html for packages not in .Library
git-svn-id: https://svn.r-project.org/R/trunk@88231 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 4972317 commit b6506d4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/library/tools/R/Vignettes.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ function(pkg, con, vignetteIndex = NULL)
10731073
else {
10741074
vignetteIndex <- cbind(Package = pkg,
10751075
as.matrix(vignetteIndex[, c("File", "Title", "PDF", "R")]))
1076-
makeVignetteTable(vignetteIndex, depth = 3L)
1076+
makeVignetteTable(vignetteIndex, depth = NULL)
10771077
})
10781078
otherfiles <- list.files(system.file("doc", package = pkg))
10791079
if(NROW(vignetteIndex))

src/library/tools/R/toHTML.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File src/library/tools/R/toHTML.R
22
# Part of the R package, https://www.R-project.org
33
#
4-
# Copyright (C) 1995-2024 The R Core Team
4+
# Copyright (C) 1995-2025 The R Core Team
55

66
toHTML <- function(x, ...) UseMethod("toHTML")
77

@@ -187,6 +187,7 @@ function(x, ...)
187187
# Argument "depth" below says how far down in the hierarchy
188188
# we are starting from, e.g. /library/stats/html/mean.html
189189
# is depth 3
190+
# .writeVignetteHtmlIndex() uses depth=NULL to omit the directory prefix.
190191

191192
makeVignetteTable <- function(vignettes, depth=2) {
192193
out <- c('<table style="width: 100%;">',
@@ -203,7 +204,8 @@ makeVignetteTable <- function(vignettes, depth=2) {
203204
File <- vignettes[i, "File"]
204205
R <- vignettes[i, "R"]
205206
pkg <- vignettes[i, "Package"]
206-
root <- c(rep.int("../", depth), "library/", pkg, "/doc/")
207+
root <- if (!is.null(depth))
208+
c(rep.int("../", depth), "library/", pkg, "/doc/")
207209
link <- c('<a href="', root,
208210
if (nchar(Outfile)) Outfile else File, '">',
209211
pkg, "::", topic, '</a>')

0 commit comments

Comments
 (0)