configureBook: Helper configuration function for books

View source: R/configureBook.R

configureBookR Documentation

Helper configuration function for books

Description

Helper function to run at the top-level directory of Bioconductor book packages, to prepare for book compilation and to set up install-time resources for linking from other books.

Usage

configureBook(prefix = NULL, input = "index.Rmd", redirect = NULL)

Arguments

prefix

Optional string containing the prefix to be used when linking from other books.

input

Name of the index file for the book, see scrapeReferences.

redirect

Optional name of the file containing redirection information, to be passed to createRedirects.

Details

This function assumes that the bookdown-formatted book is located at inst/book inside the package. input is interpreted relative to this location, e.g., if input="index.Rmd", the file should be located at inst/book/index.Rmd.

Similarly, redirect is provided, the file should already be present in vignettes/. For example, if redirect="redirect.txt", the file should be located at vignettes/redirect.txt.

Value

A number of files are created in the package directory.

  • A "references.csv" file is created in the inst/rebook directory, containing the table of references from scrapeReferences.

  • If prefix is specified, a "prefix.csv" file is also created in inst/rebook. This contains the preferred prefix of the book.

  • A Makefile is created in vignettes/ that triggers book compilation. This will also generate HTMLs for redirection via createRedirects if redirect is provided.

  • A stub vignette at vignettes/stub.Rmd is created that redirects to the deployed book location.

Author(s)

Aaron Lun

See Also

scrapeReferences, which is called by this function to create the reference table.

link, which is used by other books to link to the configured book.


LTLA/rebook documentation built on June 5, 2023, 6:24 p.m.