This avoids directory look-up failures on build systems where the
package installation directory is different from base R.
... | ... |
@@ -29,7 +29,7 @@ This assumes that authors are formatted as \code{Authors@R} and the \code{Licens |
29 | 29 |
} |
30 | 30 |
\examples{ |
31 | 31 |
wd <- getwd() |
32 |
-setwd(file.path(R.home(), 'library', 'rebook')) |
|
32 |
+setwd(system.file(package="rebook")) |
|
33 | 33 |
cat(openingDetails(), '\n') |
34 | 34 |
setwd(wd) |
35 | 35 |
} |
... | ... |
@@ -4,10 +4,12 @@ |
4 | 4 |
\alias{openingDetails} |
5 | 5 |
\title{Report opening details about the book} |
6 | 6 |
\usage{ |
7 |
-openingDetails(...) |
|
7 |
+openingDetails(..., Copyright = NULL) |
|
8 | 8 |
} |
9 | 9 |
\arguments{ |
10 | 10 |
\item{...}{Further named strings to be included in the opening details.} |
11 |
+ |
|
12 |
+\item{Copyright}{String containing copyright information; defaults to \code{"Bioconductor, <current year>"}.} |
|
11 | 13 |
} |
12 | 14 |
\value{ |
13 | 15 |
A string containing the formatted details for inclusion into a YAML header. |
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,36 @@ |
1 |
+% Generated by roxygen2: do not edit by hand |
|
2 |
+% Please edit documentation in R/openingDetails.R |
|
3 |
+\name{openingDetails} |
|
4 |
+\alias{openingDetails} |
|
5 |
+\title{Report opening details about the book} |
|
6 |
+\usage{ |
|
7 |
+openingDetails(...) |
|
8 |
+} |
|
9 |
+\arguments{ |
|
10 |
+\item{...}{Further named strings to be included in the opening details.} |
|
11 |
+} |
|
12 |
+\value{ |
|
13 |
+A string containing the formatted details for inclusion into a YAML header. |
|
14 |
+} |
|
15 |
+\description{ |
|
16 |
+Report opening details about the book, to be executed as an R expression in the \code{Date:} field. |
|
17 |
+} |
|
18 |
+\details{ |
|
19 |
+It is usually sufficient to set something like |
|
20 |
+\preformatted{date: "`r rebook::openingDetails()`" |
|
21 |
+} |
|
22 |
+in the YAML header of the book, thereby ensuring that the book details are printed after the title but before any contents. |
|
23 |
+This assumes that none of the details have problematic characters, particularly double quotes. |
|
24 |
+ |
|
25 |
+Details are extracted from a \code{DESCRIPTION} file in the current or any parent directory. |
|
26 |
+This assumes that authors are formatted as \code{Authors@R} and the \code{License} and \code{Date} fields are specified. |
|
27 |
+} |
|
28 |
+\examples{ |
|
29 |
+wd <- getwd() |
|
30 |
+setwd(file.path(R.home(), 'library', 'rebook')) |
|
31 |
+cat(openingDetails(), '\n') |
|
32 |
+setwd(wd) |
|
33 |
+} |
|
34 |
+\author{ |
|
35 |
+Aaron Lun |
|
36 |
+} |