[R-pkg-devel] Sort order of vignette index?; adding purl'ed Rcode from asis vignette to vignette index?

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Tue May 31 09:05:02 CEST 2022


On Mon, 30 May 2022 18:10:28 -0700
Carl Schwarz <cschwarzstatsfuca using gmail.com> wrote:

> I'm hoping that a simple modification to devtool::build_vignettes()
> might be the place to start, but don't know enough of the fine
> details of package building on CRAN to know if this is the place.

devtools is an unofficial package, separate from the package build
machinery.

The HTML vignette index for a package is contained in the
(library)/(package)/doc/index.html file and is generated during package
installation. The table itself is generated by
tools:::makeVignetteTable, with no sort criterion applied. According to
the comments in tools:::.install_package_vignettes3, R ≥ 3.0.2
generates the vignette index at package build time. The vignette index
is built by tools:::.build_vignette_index, again, with no sorting, from
the output of tools::pkgVignettes.

pkgVignettes() seems to loop over vignette engines, then over file name
patterns accepted by every vignette engine. A sorting step could be
added after the loop, but I'm not sure how to expose the sorting
criterion as an API. Time to ask about this on the R-devel mailing list?

As for locating the purl'ed scripts, you might be able to convince
pkgVignettes() to locate them for you if you rename and place them the
right way (you say doc/; shouldn't it be inst/doc?). Take a look at how
pkgVignettes calls tools:::find_vignette_product and what the latter
function does. But I might be wrong.

-- 
Best regards,
Ivan



More information about the R-package-devel mailing list