[R-pkg-devel] Indexing HTML vignette topics

Lenth, Russell V russell-lenth at uiowa.edu
Tue Apr 24 03:53:56 CEST 2018


Developers,

I have a package that has a number of vignettes with examples and such; so I see an increasing need to provide easier ways to navigate among them and to find a particular topic. All the vignettes are written using R Markdown, subsequently converted to HTML. 

I did some searching but did not find software that would help (though I'm sure if it exists, I'm about to hear about it). So, in case anybody is interested, I threw together a small R package named vigindex for this purpose, and it is available on github at https://github.com/rvlenth/vigindex.

It works by inserting HTML comments in the vignette .Rmd files of the form:

<!-- @index  entry1;   entry2!subentry   -->

and then running vigindex::vigindex(). This compiles all the index entries in the files in the vignette directory, and creates a new .Rmd file with the index. Each index entry is linked to the nearest section preceding each embedded entry. There are various refinements to allow for formatting and sorting.

There is an example vignette in the package, and the latest commit of https://github.com/rvlenth/emmeans has a topical index of all of its vignettes.

I'm interested in any comments or suggestions, and if anybody finds this useful.

Russ
--
Russell V. Lenth  -  Professor Emeritus
Department of Statistics and Actuarial Science   
The University of Iowa  -  Iowa City, IA 52242  USA   
Voice (319)335-0712 (Dept. office)  -  FAX (319)335-3017



More information about the R-package-devel mailing list