From 6ee8a31c5a06ca8589d277302ad4c3b54fa039a7 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Tue, 14 Nov 2023 19:49:31 -0600 Subject: [PATCH] Eliminate `@describeIn` (#452) Since this is the only place in the tidyverse that we use it. --- R/reprex-undo.R | 28 ++++++++++++++++------------ man/un-reprex.Rd | 27 +++++++++++---------------- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/R/reprex-undo.R b/R/reprex-undo.R index f1621cf3..256434f5 100644 --- a/R/reprex-undo.R +++ b/R/reprex-undo.R @@ -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, @@ -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{ @@ -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{ @@ -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{ diff --git a/man/un-reprex.Rd b/man/un-reprex.Rd index dcc110be..5e490b03 100644 --- a/man/un-reprex.Rd +++ b/man/un-reprex.Rd @@ -89,24 +89,19 @@ Character vector holding just the clean R code, invisibly 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. -} -\section{Functions}{ +wild-caught reprex: \itemize{ -\item \code{reprex_invert()}: Attempts to reverse the effect of \code{\link[=reprex]{reprex()}}. When +\item \code{reprex_invert()} attempts to reverse the effect of \code{\link[=reprex]{reprex()}}. When \code{venue = "r"}, this just calls \code{reprex_clean()}. - -\item \code{reprex_clean()}: Assumes R code is top-level, possibly interleaved with -commented output, e.g., a displayed reprex copied from GitHub or the direct -output of \code{reprex(..., venue = "R")}. This function removes commented -output. - -\item \code{reprex_rescue()}: 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. - -}} +\item \code{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 \code{reprex(..., venue = "R")}. +\item \code{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. +} +} \examples{ \dontrun{ # a roundtrip: R code --> rendered reprex, as gfm --> R code