From 75fcca917c4f7b93c7972f674b157b392cb5a71c Mon Sep 17 00:00:00 2001 From: Matthew de Queljoe Date: Mon, 13 May 2019 14:37:03 +0200 Subject: [PATCH] fix submission --- .Rbuildignore | 1 + CRAN-RELEASE | 2 ++ DESCRIPTION | 8 +++++--- NAMESPACE | 3 --- R/Rdoc_class.R | 7 +++---- R/options.R | 26 +------------------------- R/rdoc.R | 38 +++++++++++++++++++++++++++++++------- cran-comments.md | 9 +++++++++ man/rdoc.Rd | 3 +-- man/rdoc_options.Rd | 2 +- man/rdoc_question.Rd | 2 +- man/rdoc_rd.Rd | 2 +- man/rdoc_style.Rd | 2 +- man/use_rdoc.Rd | 3 +-- 14 files changed, 58 insertions(+), 50 deletions(-) create mode 100644 CRAN-RELEASE diff --git a/.Rbuildignore b/.Rbuildignore index 75e3ef3..a50b4aa 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -3,3 +3,4 @@ ^\.Rproj\.user$ ^src/\.vscode$ ^cran-comments\.md$ +^CRAN-RELEASE$ diff --git a/CRAN-RELEASE b/CRAN-RELEASE new file mode 100644 index 0000000..c54d385 --- /dev/null +++ b/CRAN-RELEASE @@ -0,0 +1,2 @@ +This package was submitted to CRAN on 2019-05-10. +Once it is accepted, delete this file and tag the release (commit 10ed5e3a53). diff --git a/DESCRIPTION b/DESCRIPTION index d659a6f..8e24a90 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,9 +4,11 @@ Title: Colourised R Documentation Version: 0.1.0 Authors@R: person("Matthew", "de Queljoe", email = "matthew.dequeljoe@gmail.com", role = c("aut", "cre")) Maintainer: Matthew de Queljoe -Description: Extends `tools::Rd2txt` by adding customisable text and colour formatting to R documentation - contents. If used from a terminal, output will be displayed via `file.show` otherwise contents - will be printed in sections. Also provides stand-in replacements for `?` and `help`. +Description: Extends tools::Rd2txt() by adding customisable text and colour formatting to R documentation + contents. If used from a terminal, output will be displayed via file.show() otherwise contents + will be printed in sections. Also provides stand-in replacements for ?() and help(). +URL: https://github.com/mdequeljoe/rdoc +BugReports: https://github.com/mdequeljoe/rdoc/issues License: GPL-3 Encoding: UTF-8 LazyData: true diff --git a/NAMESPACE b/NAMESPACE index ca0e1c5..2a6ec54 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -12,10 +12,7 @@ export(rdoc_text_formats) export(rdoc_usage) export(rm_rdoc) export(use_rdoc) -importFrom(R6,R6Class) importFrom(cli,boxx) importFrom(crayon,has_style) importFrom(crayon,strip_style) -importFrom(tools,Rd2txt) importFrom(utils,"?") -importFrom(utils,help) diff --git a/R/Rdoc_class.R b/R/Rdoc_class.R index 4b82f57..4653c50 100644 --- a/R/Rdoc_class.R +++ b/R/Rdoc_class.R @@ -1,6 +1,5 @@ -#' @importFrom tools Rd2txt -#' @importFrom R6 R6Class -Rdoc <- R6Class( + +Rdoc <- R6::R6Class( "Rdoc", public = list( topic = NULL, @@ -120,7 +119,7 @@ Rdoc$set("private", "get_rdo", function(){ Rdoc$set("private", "rd_to_text", function(){ tmp_ <- tempfile(fileext = ".txt") on.exit(unlink(tmp_)) - Rd2txt( + tools::Rd2txt( private$rdo, out = tmp_, options = list( diff --git a/R/options.R b/R/options.R index 435ad73..de9c619 100644 --- a/R/options.R +++ b/R/options.R @@ -9,7 +9,7 @@ #' styles to be passed on to \code{prettycode::highlight} #' @details all inputs should be functions or \code{NULL} with the exception of #' \code{code_style} which should be a list of functions. -#' @examples \dontrun{ +#' @examples \donttest{ #' options(rdoc.style = rdoc::rdoc_style(arguments = crayon::italic)) #' } #' @return A list @@ -107,27 +107,3 @@ rd_opts <- function() { ) } -#' rdoc options -#' -#' @description -#' -#' Rdoc uses the following \code{options()} to set output: -#' -#' \itemize{ \item `rdoc.by_section`: logical, output interactively printed by -#' sections for console sessions. Sections will be printed with the -#' keypress. Any other keypress will exit the interaction without printing the -#' remaining sections. Default is TRUE. -#' -#' \item `rdoc.header`: logical, whether package header is included in the -#' output. Default is TRUE. -#' -#' \item `rdoc.text_formats`: see \code{\link{rdoc_text_formats}} -#' -#' \item `rdoc.style`: see \code{\link{rdoc_style}} -#' -#' \item `rdoc.item_bullet`: Symbol to use for itemized lists. Default is -#' \code{paste0(cli::symbol$circle, " ")} } -#' @docType package -#' @name rdoc_options -NULL - diff --git a/R/rdoc.R b/R/rdoc.R index 8a5627f..22abb27 100644 --- a/R/rdoc.R +++ b/R/rdoc.R @@ -1,4 +1,4 @@ -#' @importFrom utils help + rd_ <- function(which = NULL, method = "show") { function(topic, package = NULL, @@ -55,7 +55,7 @@ rd_ <- function(which = NULL, method = "show") { #' \code{crayon::has_color()}. Customising rdoc output is possible via #' `options`, see \code{\link{rdoc_options}} for more details. #' -#' @examples \dontrun{ +#' @examples \donttest{ #' #' library(rdoc) #' rdoc("rdoc") @@ -80,7 +80,6 @@ rdoc_arguments <- rd_("arguments") rdoc_details <- rd_("details") #' @rdname rdoc -#' @aliases rd_examples #' @export rdoc_examples <- rd_("examples") @@ -102,7 +101,7 @@ rdoc_text <- rd_(method = "rdoc_text") #' @param path character(1), the path to an .Rd file #' #' @inherit rdoc details -#' @examples \dontrun{ +#' @examples \donttest{ #' d <- system.file('extdata/rdoc_test.Rd', package = "rdoc") #' rdoc::rdoc_rd(d) #' } @@ -123,7 +122,7 @@ rdoc_rd <- function(path){ #' @inherit rdoc details #' @inheritParams utils::`?` #' @importFrom utils ? -#' @examples \dontrun{ +#' @examples \donttest{ #' #' rdoc::rdoc_question('lapply') #' @@ -164,8 +163,7 @@ rdoc_question <- function(type, topic) { #' Calling \code{use_rdoc()} will override \code{utils::`?`} with \code{rdoc_question} #' and \code{utils::help} with \code{rdoc} #' These replacements can be unset by calling \code{rm_rdoc()}. -#' @examples \dontrun{ -#' +#' @examples \donttest{ #' rdoc::use_rdoc() #' ?help #' rdoc::rm_rdoc() @@ -191,3 +189,29 @@ rm_rdoc <- function(){ return(invisible(NULL)) base::detach("rdoc") } + + +#' rdoc options +#' +#' @description +#' +#' Rdoc uses the following \code{options()} to set output: +#' +#' \itemize{ \item `rdoc.by_section`: logical, output interactively printed by +#' sections for console sessions. Sections will be printed with the +#' keypress. Any other keypress will exit the interaction without printing the +#' remaining sections. Default is TRUE. +#' +#' \item `rdoc.header`: logical, whether package header is included in the +#' output. Default is TRUE. +#' +#' \item `rdoc.text_formats`: see \code{\link{rdoc_text_formats}} +#' +#' \item `rdoc.style`: see \code{\link{rdoc_style}} +#' +#' \item `rdoc.item_bullet`: Symbol to use for itemized lists. Default is +#' \code{paste0(cli::symbol$circle, " ")} } +#' @docType package +#' @name rdoc_options +NULL + diff --git a/cran-comments.md b/cran-comments.md index 4101343..38b1104 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,3 +1,12 @@ +## Resubmission + +This is a resubmission in which the following changes have been made: + +* Ensuring all exported objects have documentation +* adding '()' to function names and removing their quotation marks +* replacing \dontrun with \donttest where required +* adding URL and BugReports field to DESCRIPTION + ## Test environments * local macOS Mojave 10.14, R 3.6.0 diff --git a/man/rdoc.Rd b/man/rdoc.Rd index f17a906..c1ee63a 100644 --- a/man/rdoc.Rd +++ b/man/rdoc.Rd @@ -6,7 +6,6 @@ \alias{rdoc_arguments} \alias{rdoc_details} \alias{rdoc_examples} -\alias{rd_examples} \title{Colourised \R documentation} \usage{ rdoc(topic, package = NULL, lib.loc = NULL) @@ -45,7 +44,7 @@ The manner in which content is outputted depends on where it is `options`, see \code{\link{rdoc_options}} for more details. } \examples{ -\dontrun{ +\donttest{ library(rdoc) rdoc("rdoc") diff --git a/man/rdoc_options.Rd b/man/rdoc_options.Rd index 4057e86..e6d168b 100644 --- a/man/rdoc_options.Rd +++ b/man/rdoc_options.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/options.R +% Please edit documentation in R/rdoc.R \docType{package} \name{rdoc_options} \alias{rdoc_options} diff --git a/man/rdoc_question.Rd b/man/rdoc_question.Rd index 0ef24c0..3bb6999 100644 --- a/man/rdoc_question.Rd +++ b/man/rdoc_question.Rd @@ -42,7 +42,7 @@ The manner in which content is outputted depends on where it is `options`, see \code{\link{rdoc_options}} for more details. } \examples{ -\dontrun{ +\donttest{ rdoc::rdoc_question('lapply') diff --git a/man/rdoc_rd.Rd b/man/rdoc_rd.Rd index 9756fe1..eacbf52 100644 --- a/man/rdoc_rd.Rd +++ b/man/rdoc_rd.Rd @@ -24,7 +24,7 @@ The manner in which content is outputted depends on where it is `options`, see \code{\link{rdoc_options}} for more details. } \examples{ -\dontrun{ +\donttest{ d <- system.file('extdata/rdoc_test.Rd', package = "rdoc") rdoc::rdoc_rd(d) } diff --git a/man/rdoc_style.Rd b/man/rdoc_style.Rd index c5fba53..2265e23 100644 --- a/man/rdoc_style.Rd +++ b/man/rdoc_style.Rd @@ -29,7 +29,7 @@ all inputs should be functions or \code{NULL} with the exception of \code{code_style} which should be a list of functions. } \examples{ -\dontrun{ +\donttest{ options(rdoc.style = rdoc::rdoc_style(arguments = crayon::italic)) } } diff --git a/man/use_rdoc.Rd b/man/use_rdoc.Rd index e68a59a..29e97d1 100644 --- a/man/use_rdoc.Rd +++ b/man/use_rdoc.Rd @@ -18,8 +18,7 @@ and \code{utils::help} with \code{rdoc} These replacements can be unset by calling \code{rm_rdoc()}. } \examples{ -\dontrun{ - +\donttest{ rdoc::use_rdoc() ?help rdoc::rm_rdoc()