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

Max Turgeon M@x@Turgeon @end|ng |rom um@n|tob@@c@
Tue May 31 16:50:24 CEST 2022


Hi Carl and Ivan,

According to WRE Section 1.4, you may be able to override what tools:::.build_vignette_index creates:

"At install time an HTML index for all vignettes in the package is automatically created from the \VignetteIndexEntry statements unless a file index.html exists in directory inst/doc. This index is linked from the HTML help index for the package."

Unfortunately, I have no experience writing my own inst/doc/index.html. Maybe someone else on this list can provide some pointers.

Best,


Max Turgeon<https://www.name-coach.com/maxime-turgeon>
Assistant Professor

Department of Statistics
University of Manitoba

maxturgeon.ca<http://maxturgeon.ca/>

________________________________
From: R-package-devel <r-package-devel-bounces using r-project.org> on behalf of Ivan Krylov <krylov.r00t using gmail.com>
Sent: Tuesday, May 31, 2022 2:05 AM
To: Carl Schwarz <cschwarzstatsfuca using gmail.com>
Cc: r-package-devel using r-project.org <r-package-devel using r-project.org>
Subject: Re: [R-pkg-devel] Sort order of vignette index?; adding purl'ed Rcode from asis vignette to vignette index?

********************************************************
Caution: This message was sent from outside the University of Manitoba.
********************************************************

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

______________________________________________
R-package-devel using r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list