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

Carl Schwarz c@chw@rz@t@t@|uc@ @end|ng |rom gm@||@com
Tue May 31 03:10:28 CEST 2022


Thanks DM...

I'm most interested in the HTML index from the help system.

Indeed the sort orders are different with the browseVignettes() sorting by
title.
But the sort order of the HTML system is neither the title nor the file
name. I found an old post from 2017 (
https://www.mail-archive.com/r-package-devel@r-project.org/msg01479.html)
with a similar query and it appears that the sort order for the html system
might be

1. file type (.Rmd, then .Rnw)
2. alphabetically by file name


If correct, this seems like an odd sort order for the HTML system. In my
case the order appears to be .asis, .Rmd, Rnw.

I'm willing to put some work on modifying the sort order if this is a
sensible solution but don't know where to start.
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.

For example, I could imaging an argument to build_vignetter() that controls
the sort order, e.g. sort_vignettes_by=c("filename","title") so the user
could choose, with argument to the R CMD build process that changes this as
needed.

Carl

On Mon, May 30, 2022 at 2:50 PM Duncan Murdoch <murdoch.duncan using gmail.com>
wrote:

> On 26/05/2022 8:33 p.m., Carl Schwarz wrote:
> > (a) How is the sort order of vignettes in the vignette index determined?
> > Can I change it?
>
> You should specify which vignette index you are looking at.  Is it the
> one linked from the HTML help system, or the one you see when you use
> browseVignettes()?  They might be the same, but I wouldn't bet on that.
>
> Duncan Murdoch
>
>
> >
> > I have several types of vignettes - an old style .RNW file, a pdf file
> > externally created for which I've created an .pdf.asis; a regular
> Rmarkdown
> > (*.Rmd) file; and an Rmarkdown file that takes too long to compile
> > (bootstrapping involved) for which I've created a static html file and
> the
> > *.html.asis file.
> >
> > I've named the vignettes as a-.., b-.. c-..., d-... to try and establish
> a
> > "sensible" (alphabetical) sort order, but the vignette index has some odd
> > ordering.
> >
> > So.. what determines the sort order of entries in the vignette index.
> Can I
> > control this?
> >
> > I've tried changing the order in the Meta/vignette.rds file manually, but
> > when you build a source package, that gets overwritten.
> >
> > Have a look at the package index to the
> >      SightabilityModel
> > package (currently missing one of the vignettes but that is another
> issue).
> >
> > --------------------------
> > (b) Related to the static *.html.asis vignette - i would like to also
> > include the purl()'d R code from the Rmd file. I can generate the
> purl()'d
> > R script, place it in the doc/ directory, but the vignette index builder
> > ignores this.
> >
> > Is there a way to modify the vignette index to point to R code that
> wasn't
> > generated automatically?
> >
> > Thanks
> >
> > Carl Schwarz
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > 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