diff --git a/.gitignore b/.gitignore index 0cbd21380..ec6b2a474 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ ## Qt Creator *.pro *.pro.user +inst/doc diff --git a/DESCRIPTION b/DESCRIPTION index fdd2b1736..7d000a567 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -11,22 +11,23 @@ Authors@R: c( person("Manuel", "Eugster", role = c("aut", "cph")), person("RStudio", role = "cph") ) -Depends: +Depends: R (>= 3.0.2) -Imports: +Imports: stringr (>= 0.5), stringi, brew, digest, methods, Rcpp (>= 0.11.0) -Suggests: +Suggests: testthat (>= 0.8.0), knitr, - devtools + devtools, + rmarkdown VignetteBuilder: knitr LinkingTo: Rcpp -Collate: +Collate: 'RcppExports.R' 'alias.R' 'default-data-format.R' diff --git a/vignettes/collate.Rmd b/vignettes/collate.Rmd index 6b3320808..be76d8d48 100644 --- a/vignettes/collate.Rmd +++ b/vignettes/collate.Rmd @@ -1,18 +1,18 @@ - +--- +title: "Collation order" +author: "Hadley Wickham" +date: "`r Sys.Date()`" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Collation order} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- -```{r, echo = FALSE, message = FALSE} -knitr::opts_chunk$set( - comment = "#>", - error = FALSE, - tidy = FALSE -) +```{r, include = FALSE} +knitr::opts_chunk$set(comment = "#>", collapse = TRUE) ``` -# Collation order - R loads files in alphabetical order. Unfortunately not every alphabet puts letters in the same order, so you can't rely on alphabetic ordering if you need one file loaded before another. The order in which files are loaded doesn't matter for most packages. But if you're using S4, you'll need to make sure that classes are loaded before subclasses and generics are defined before methods. Rather than relying on alphabetic ordering, roxygen2 provides an explicit way of saying that one file must be loaded before another: `@include`. The `@include` tag gives a space separated list of file names that should be loaded before the current file: diff --git a/vignettes/formatting.Rmd b/vignettes/formatting.Rmd index 3d54aec49..3a23153a6 100644 --- a/vignettes/formatting.Rmd +++ b/vignettes/formatting.Rmd @@ -1,18 +1,18 @@ - - -```{r, echo = FALSE, message = FALSE} -knitr::opts_chunk$set( - comment = "#>", - error = FALSE, - tidy = FALSE -) +--- +title: "Text formatting reference sheet" +author: "Hadley Wickham" +date: "`r Sys.Date()`" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Text formatting reference sheet} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r, include = FALSE} +knitr::opts_chunk$set(comment = "#>", collapse = TRUE) ``` -# Text formatting reference sheet - Within roxygen tags, you use `.Rd` syntax to format text. This vignette shows you examples of the most important commands. The full details are described in [R extensions](http://cran.r-project.org/doc/manuals/R-exts.html#Marking-text). Note that `\` and `%` are special characters. To insert literals, escape with a backslash: `\\`, `\%`. diff --git a/vignettes/namespace.Rmd b/vignettes/namespace.Rmd index b4df88ed0..f83e81992 100644 --- a/vignettes/namespace.Rmd +++ b/vignettes/namespace.Rmd @@ -1,18 +1,18 @@ - - -```{r, echo = FALSE, message = FALSE} -knitr::opts_chunk$set( - comment = "#>", - error = FALSE, - tidy = FALSE -) +--- +title: "Package namespace" +author: "Hadley Wickham" +date: "`r Sys.Date()`" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Package namespace} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r, include = FALSE} +knitr::opts_chunk$set(comment = "#>", collapse = TRUE) ``` -# Package namespace - The package `NAMESPACE` is one of the most confusing parts of building a package. Roxygen2 aims to make it as easy as possible to build a package that is a well-behaved member of the R ecosystem. This is a little frustrating at first, but soon becomes second-nature. ## Exports diff --git a/vignettes/rd.Rmd b/vignettes/rd.Rmd index f0810f0ee..4a2bb6c53 100644 --- a/vignettes/rd.Rmd +++ b/vignettes/rd.Rmd @@ -1,18 +1,18 @@ - - -```{r, echo = FALSE, message = FALSE} -knitr::opts_chunk$set( - comment = "#>", - error = FALSE, - tidy = FALSE, - collapse = TRUE -) +--- +title: "Generating Rd files" +author: "Hadley Wickham" +date: "`r Sys.Date()`" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Generating Rd files} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r, include = FALSE} +knitr::opts_chunk$set(comment = "#>", collapse = TRUE) ``` -# Generating Rd files ## Roxygen process diff --git a/vignettes/rdkeywords.Rmd b/vignettes/rdkeywords.Rmd index 28eb1e7ba..072909471 100644 --- a/vignettes/rdkeywords.Rmd +++ b/vignettes/rdkeywords.Rmd @@ -1,18 +1,18 @@ - +--- +title: "Rd keywords" +author: "Hadley Wickham" +date: "`r Sys.Date()`" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Rd keywords} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- -```{r, echo = FALSE, message = FALSE} -knitr::opts_chunk$set( - comment = "#>", - error = FALSE, - tidy = FALSE -) +```{r, include = FALSE} +knitr::opts_chunk$set(comment = "#>", collapse = TRUE) ``` -# Keywords - ```{r} cat(readLines(file.path(R.home("doc"), "KEYWORDS")), sep = "\n") ``` diff --git a/vignettes/roxygen2.Rmd b/vignettes/roxygen2.Rmd index 1dd58a5eb..cd4104658 100644 --- a/vignettes/roxygen2.Rmd +++ b/vignettes/roxygen2.Rmd @@ -1,18 +1,18 @@ - - -```{r, echo = FALSE, message = FALSE} -knitr::opts_chunk$set( - comment = "#>", - error = FALSE, - tidy = FALSE -) +--- +title: "Introduction to roxygen2" +author: "Hadley Wickham" +date: "`r Sys.Date()`" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Introduction to roxygen2} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r, include = FALSE} +knitr::opts_chunk$set(comment = "#>", collapse = TRUE) ``` -# Introduction to roxygen2 - Documentation is one of the most important aspects of good code. Without it, users won't know how to use your package, and are unlikely to do so. Documentation is also useful for you in the future (so you remember what the heck you were thinking!), and for other developers working on your package. The goal of roxygen2 is to make documenting your code as easy as possible. R provides a standard way of documenting packages: you write `.Rd` files in the `man/` directory. These files use a custom syntax, loosely based on latex. Roxygen2 provides a number of advantages over writing `.Rd` files by hand: * Code and documentation are adjacent so when you modify your code, it's easy