Skip to content

Commit

Permalink
Eliminate @describeIn
Browse files Browse the repository at this point in the history
Since this is the only place in the tidyverse that we use it.
  • Loading branch information
hadley committed Nov 14, 2023
1 parent b904f73 commit b34a093
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 28 deletions.
28 changes: 16 additions & 12 deletions R/reprex-undo.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@
#' Recover clean, runnable code from a reprex captured in the wild and write it
#' to user's clipboard. The code is also returned invisibly and optionally
#' written to file. Three different functions address various forms of
#' wild-caught reprex.
#' wild-caught reprex:
#'
#' * `reprex_invert()` attempts to reverse the effect of [reprex()]. When
#' `venue = "r"`, this just calls `reprex_clean()`.
#'
#' * `reprex_clean()` removes commented output. This assumes that R code is
#' top-level, possibly interleaved with commented output, e.g., a displayed
#' reprex copied from GitHub or the output of `reprex(..., venue = "R")`.
#'
#' * `reprex_rescue()` removes lines of output and strips prompts from lines
#' holding R commands. This assumes that R code lines start with a prompt and
#' that printed output is top-level, e.g., what you'd if you've copied from
#' the R Console.
#'
#' @inheritParams reprex
#' @param input Character. If has length one and lacks a terminating newline,
Expand All @@ -19,9 +31,7 @@
#' @name un-reprex
NULL

#' @describeIn un-reprex Attempts to reverse the effect of [reprex()]. When
#' `venue = "r"`, this just calls `reprex_clean()`.
#' @inheritParams reprex
#' @rdname un-reprex
#' @export
#' @examples
#' \dontrun{
Expand Down Expand Up @@ -62,10 +72,7 @@ reprex_invert <- function(input = NULL,
reprex_undo(input, wd = wd, is_md = TRUE, comment = comment, outfile = outfile)
}

#' @describeIn un-reprex Assumes R code is top-level, possibly interleaved with
#' commented output, e.g., a displayed reprex copied from GitHub or the direct
#' output of `reprex(..., venue = "R")`. This function removes commented
#' output.
#' @rdname un-reprex
#' @export
#' @examples
#' \dontrun{
Expand All @@ -88,10 +95,7 @@ reprex_clean <- function(input = NULL,
reprex_undo(input, wd = wd, is_md = FALSE, comment = comment, outfile = outfile)
}

#' @describeIn un-reprex Assumes R code lines start with a prompt and that
#' printed output is top-level, e.g., what you'd get from copy/paste from the
#' R Console. Removes lines of output and strips prompts from lines holding R
#' commands.
#' @rdname un-reprex
#' @export
#' @examples
#' \dontrun{
Expand Down
27 changes: 11 additions & 16 deletions man/un-reprex.Rd

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

0 comments on commit b34a093

Please sign in to comment.