diff --git a/DESCRIPTION b/DESCRIPTION index 6ac956157..189cf906c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -59,3 +59,4 @@ Collate: 'usage.R' 'util-locale.R' 'utils.R' +RoxygenNote: 4.1.1.9000 diff --git a/NAMESPACE b/NAMESPACE index bb930114c..fcede724e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1,4 @@ -# Generated by roxygen2 (4.1.1.9000): do not edit by hand +# Generated by roxygen2: do not edit by hand S3method(c,rd) S3method(clean,had) diff --git a/NEWS.md b/NEWS.md index 3cccb4866..00eca07f3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # roxygen2 4.1.1.9000 +* Roxygen now records its version in a single place: the `RoxygenNote` + field in the `DESCRIPTION` (#338). + * `\usage{}` is correctly generated for functions with string arguments containing `"\""` (#265). diff --git a/R/roxygenize.R b/R/roxygenize.R index 58a40f9d4..ca1b6326d 100644 --- a/R/roxygenize.R +++ b/R/roxygenize.R @@ -40,6 +40,7 @@ roxygenize <- function(package.dir = ".", base_path <- normalizePath(package.dir) man_path <- file.path(base_path, "man") dir.create(man_path, recursive = TRUE, showWarnings = FALSE) + update_roxygen_version(base_path) options <- load_options(base_path) roclets <- roclets %||% options$roclets diff --git a/R/safety.R b/R/safety.R index 030fa229a..01f219335 100644 --- a/R/safety.R +++ b/R/safety.R @@ -33,6 +33,18 @@ check_made_by <- function(first) { } made_by <- function(comment) { - paste0(comment, " Generated by roxygen2 (", packageVersion("roxygen2"), - "): do not edit by hand\n") + paste0(comment, " Generated by roxygen2: do not edit by hand\n") +} + +update_roxygen_version <- function(base_path) { + desc_path <- file.path(base_path, "DESCRIPTION") + old <- read.description(desc_path) + + new <- old + new$RoxygenNote <- packageVersion("roxygen2") + + if (!identical(old, new)) { + cat('Updating roxygen version in ', desc_path, "\n") + write.description(new, desc_path) + } } diff --git a/man/is_s3_generic.Rd b/man/is_s3_generic.Rd index e1850d429..0c152b756 100644 --- a/man/is_s3_generic.Rd +++ b/man/is_s3_generic.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/s3.R \name{is_s3_generic} \alias{is_s3_generic} diff --git a/man/namespace_roclet.Rd b/man/namespace_roclet.Rd index 9a6ec374b..ba8f1ed5c 100644 --- a/man/namespace_roclet.Rd +++ b/man/namespace_roclet.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/roclet-namespace.R \name{namespace_roclet} \alias{S3method} diff --git a/man/new_roclet.Rd b/man/new_roclet.Rd index 4a30de4f4..a616a6825 100644 --- a/man/new_roclet.Rd +++ b/man/new_roclet.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/roclet.R \name{new_roclet} \alias{new_roclet} diff --git a/man/object.Rd b/man/object.Rd index 424fd22a7..8098abb93 100644 --- a/man/object.Rd +++ b/man/object.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/object.R \name{object} \alias{object} diff --git a/man/rd_roclet.Rd b/man/rd_roclet.Rd index b7257bec9..e25deacd4 100644 --- a/man/rd_roclet.Rd +++ b/man/rd_roclet.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/roclet-rd.R \name{rd_roclet} \alias{rd_roclet} diff --git a/man/register-parser.Rd b/man/register-parser.Rd index 84667cd03..7d7c2088f 100644 --- a/man/register-parser.Rd +++ b/man/register-parser.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/parse-registry.R \name{register.preref.parser} \alias{register.preref.parser} diff --git a/man/roc_proc_text.Rd b/man/roc_proc_text.Rd index d29f8a4a3..0c4850980 100644 --- a/man/roc_proc_text.Rd +++ b/man/roc_proc_text.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/roclet.R \name{roc_proc_text} \alias{roc_proc_text} diff --git a/man/roxygen.Rd b/man/roxygen.Rd index 6453a2222..b4e2897a1 100644 --- a/man/roxygen.Rd +++ b/man/roxygen.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/roxygen.R \docType{package} \name{roxygen} diff --git a/man/roxygenize.Rd b/man/roxygenize.Rd index 1fc7533c5..7b2328626 100644 --- a/man/roxygenize.Rd +++ b/man/roxygenize.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/roxygenize.R \name{roxygenize} \alias{roxygenise} diff --git a/man/source_package.Rd b/man/source_package.Rd index 1888865f8..ba86f1f69 100644 --- a/man/source_package.Rd +++ b/man/source_package.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/source.R \name{source_package} \alias{source_package} diff --git a/man/update_collate.Rd b/man/update_collate.Rd index 44466cb1a..504393044 100644 --- a/man/update_collate.Rd +++ b/man/update_collate.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/roclet-collate.R \name{update_collate} \alias{update_collate} diff --git a/man/vignette_roclet.Rd b/man/vignette_roclet.Rd index d2d95be37..a6360eba6 100644 --- a/man/vignette_roclet.Rd +++ b/man/vignette_roclet.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/roclet-vignette.R \name{vignette_roclet} \alias{vignette_roclet}