Skip to content

Commit

Permalink
fix submission
Browse files Browse the repository at this point in the history
  • Loading branch information
mdequeljoe committed May 13, 2019
1 parent 10ed5e3 commit 75fcca9
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 50 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
^\.Rproj\.user$
^src/\.vscode$
^cran-comments\.md$
^CRAN-RELEASE$
2 changes: 2 additions & 0 deletions CRAN-RELEASE
Original file line number Diff line number Diff line change
@@ -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).
8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ Title: Colourised R Documentation
Version: 0.1.0
Authors@R: person("Matthew", "de Queljoe", email = "[email protected]", role = c("aut", "cre"))
Maintainer: Matthew de Queljoe <[email protected]>
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
Expand Down
3 changes: 0 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
7 changes: 3 additions & 4 deletions R/Rdoc_class.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#' @importFrom tools Rd2txt
#' @importFrom R6 R6Class
Rdoc <- R6Class(

Rdoc <- R6::R6Class(
"Rdoc",
public = list(
topic = NULL,
Expand Down Expand Up @@ -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(
Expand Down
26 changes: 1 addition & 25 deletions R/options.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <enter>
#' 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

38 changes: 31 additions & 7 deletions R/rdoc.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @importFrom utils help

rd_ <- function(which = NULL, method = "show") {
function(topic,
package = NULL,
Expand Down Expand Up @@ -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")
Expand All @@ -80,7 +80,6 @@ rdoc_arguments <- rd_("arguments")
rdoc_details <- rd_("details")

#' @rdname rdoc
#' @aliases rd_examples
#' @export
rdoc_examples <- rd_("examples")

Expand All @@ -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)
#' }
Expand All @@ -123,7 +122,7 @@ rdoc_rd <- function(path){
#' @inherit rdoc details
#' @inheritParams utils::`?`
#' @importFrom utils ?
#' @examples \dontrun{
#' @examples \donttest{
#'
#' rdoc::rdoc_question('lapply')
#'
Expand Down Expand Up @@ -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()
Expand All @@ -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 <enter>
#' 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

9 changes: 9 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions man/rdoc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/rdoc_options.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/rdoc_question.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/rdoc_rd.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/rdoc_style.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/use_rdoc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 75fcca9

Please sign in to comment.