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
66toHTML <- 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
191192makeVignetteTable <- 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