getPkgVigList: A function to retrieve a listing of package vignettes

Description Usage Arguments Details Author(s) See Also Examples

View source: R/vigList.R

Description

Functionality to retrive vignette metadata, on a per-vignette or a per-package level.

Usage

1
2
3
4
getPkgVigList(pkg, vigDescFun=baseVigDesc, vigPath = "/doc/", 
vigExt="\\.(Rnw|Snw|rnw|snw|Rtex)$", pkgVers = TRUE)

getVigInfo(vig,pkg=NULL, vigDescFun=baseVigDesc, pkgVers=TRUE)

Arguments

pkg

Path to a package directory

vig

Filename of a vignette

vigDescFun

Function to provide output string for display

vigPath

Path to directory that contains vignettes in the package

vigExt

Regular expression pattern to match vignette file extensions

pkgVers

Record the package version with the other vignette metadata

Details

getPkgVigList: This function will look at all vignette files in the directory <pkg>/<vigPath>. It will then extract any header information (using getVigInfo), and return a list of this information.

getVigInfo: This function will retrieve the metadata from a particular vignette file. Any line starting with '%\Vignette' is taken to be metadata. Common values include VignetteIndexEntry (required), VignetteKeywords, VignetteDepends, etc. A named list of lists is returned to the user, where the names correspond to the particular metadata variable.

Both functions take a parameter baseVigDesc, which is a function to provide the output string to correspond with a vignette summary. This function is directly called by getVigInfo. It takes one parameter, which is a vigInfo list from getVigInfo.

Author(s)

Jeff Gentry

See Also

vignette

Examples

1
2
3
4
5
6
7
## Not run: 
   ## We need a vignette for this to work
   dynPath <- system.file(package="DynDoc")
   vigList <- getPkgVigList(dynPath)
   vigList

## End(Not run)

DynDoc documentation built on Nov. 8, 2020, 6:48 p.m.

Related to getPkgVigList in DynDoc...