openingDetails: Report opening details about the book

Description Usage Arguments Details Value Author(s) Examples

View source: R/openingDetails.R

Description

Report opening details about the book, to be executed as an R expression in the Date: field.

Usage

1

Arguments

...

Further named strings to be included in the opening details.

Details

It is usually sufficient to set something like

1
date: "`r rebook::openingDetails()`"

in the YAML header of the book, thereby ensuring that the book details are printed after the title but before any contents. This assumes that none of the details have problematic characters, particularly double quotes.

Details are extracted from a DESCRIPTION file in the current or any parent directory. This assumes that authors are formatted as Authors@R and the License and Date fields are specified.

Value

A string containing the formatted details for inclusion into a YAML header.

Author(s)

Aaron Lun

Examples

1
2
3
4
wd <- getwd()
setwd(file.path(R.home(), 'library', 'rebook'))
cat(openingDetails(), '\n')
setwd(wd)

rebook documentation built on Nov. 8, 2020, 4:56 p.m.