[R-pkg-devel] Package vignette index
Paul Johnson
p@uljohn32 @ending from gm@il@com
Tue Aug 14 20:38:04 CEST 2018
Can one of you confirm this answer: The --as-cran package checker is
looking for "build/vignette.rds", not "vignettes/index.html" as I
thought. Details below.
On Mon, Aug 13, 2018 at 12:20 PM, Paul Johnson <pauljohn32 using gmail.com> wrote:
> Can you advise me about this warning in package check:
>
> Package has a VignetteBuilder field but no prebuilt vignette index.
>
> In my vignette folder, I do have an "index.html" file, the index in
> the installed package is fine. But I still get this package build
> warning:
>
> I asked same question on stackoverflow, am not getting any help yet
>
> https://stackoverflow.com/questions/51792384/r-package-vignette-no-vignette-index-warning
>
Explanation
Although the index.html file is described in the documentation
(https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Non_002dSweave-vignettes),
the file that is actually crucial is
build/vignette.rds
That folder & file is created by R CMD build if the parameter
"--no-build-vignettes" is not used. Otherwise, the warning occurs even
if index.html exists.
In the R source code src/library/tools/R/QC.R, find the function
".check_package_CRAN_incoming". That function gives the warning about
the lack of a pre-built vignette index. It looks for
"build/vignette.rds" in the package.
vds <- character()
if(!is.na(meta["VignetteBuilder"])) {
if(!file.exists(vds <- file.path(dir, "build", "vignette.rds")))
out$missing_vignette_index <- TRUE
else
vds <- readRDS(vds)[, "File"]
}
and then later
if(length(y <- x$missing_vignette_index)) {
"Package has a VignetteBuilder field but no prebuilt vignette index."
},
vignette.rds is a data frame that has the content required to build an
index.html file.
After inserting a build folder in my package source with the
vignette.rds file, then the warning from "R CMD check --as-cran" was
silenced.
pj
--
Paul E. Johnson http://pj.freefaculty.org
Director, Center for Research Methods and Data Analysis http://crmda.ku.edu
To write to me directly, please address me at pauljohn at ku.edu.
More information about the R-package-devel
mailing list