Przeglądaj źródła

regexplain gadget now returns the built regexp as a character string

main
Garrick Aden-Buie 5 lat temu
rodzic
commit
e3630da787
6 zmienionych plików z 34 dodań i 6 usunięć
  1. +1
    -1
      DESCRIPTION
  2. +3
    -0
      R/gadget.R
  3. +3
    -2
      R/gadget_server.R
  4. +21
    -0
      man/regexplain-deprecated.Rd
  5. +4
    -0
      man/regexplain_gadget.Rd
  6. +2
    -3
      man/view_regex.Rd

+ 1
- 1
DESCRIPTION Wyświetl plik

@@ -48,4 +48,4 @@ Suggests:
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.0
RoxygenNote: 7.1.1

+ 3
- 0
R/gadget.R Wyświetl plik

@@ -17,6 +17,9 @@
#' @param pattern Regular Expression to edit or visualize using RegExplain
#' @param start_page Open gadget to this tab, one of `"Text"`, `"RegEx"`,
#' `"Output"`, or `"Help"`
#'
#' @return The regular expression built in the app is returned as a character
#' string.
#' @export
regexplain_gadget <- function(
text = NULL,

+ 3
- 2
R/gadget_server.R Wyświetl plik

@@ -726,7 +726,8 @@ regexplain_gadget_server <- function(update_available = NULL) {
# ---- Server - Tab - Exit ----
observeEvent(input$done, {
if (pattern() != "") {
pattern <- paste0('pattern <- "', escape_backslash(pattern()), '"')
regexp <- escape_backslash(pattern())
pattern <- paste0('pattern <- "', regexp, '"')
if (any(c("perl", "fixed", "ignore.case", "useBytes") %in% input$regex_options)) {
options <- input$regex_options[!input$regex_options %in% c("text_break_lines", "global")]
options <- paste0(options, "=TRUE", collapse = ", ")
@@ -743,7 +744,7 @@ regexplain_gadget_server <- function(update_available = NULL) {
}
rstudioapi::sendToConsole(pattern, FALSE)
}
stopApp()
stopApp(regexp)
})

observeEvent(input$cancel, {

+ 21
- 0
man/regexplain-deprecated.Rd Wyświetl plik

@@ -0,0 +1,21 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/regexplain-deprecated.R
\name{regexplain-deprecated}
\alias{regexplain-deprecated}
\alias{regex_gadget}
\title{Deprecated or renamed functions}
\usage{
regex_gadget(...)
}
\arguments{
\item{...}{Arguments passed to the new or renamed functions.}
}
\value{
The result of the new or renamed function.
}
\description{
These functions in regexplain have been deprecated or renamed.

Use \code{\link[=regexplain_gadget]{regexplain_gadget()}} instead of \code{regex_gadget()}.
}
\keyword{internal}

+ 4
- 0
man/regexplain_gadget.Rd Wyświetl plik

@@ -52,6 +52,10 @@ respect the setting from any previous calls to \code{enableBookmarking()}.
See \code{\link[shiny:enableBookmarking]{enableBookmarking()}} for more information.}
}}
}
\value{
The regular expression built in the app is returned as a character
string.
}
\description{
The function behind the RegExplain Selection and RegExplain File
addins. Opens the RegExplain gadget interface in an RStudio viewer

+ 2
- 3
man/view_regex.Rd Wyświetl plik

@@ -20,7 +20,7 @@ view_regex(
\item{pattern}{Regex pattern to look for}

\item{...}{
Arguments passed on to \code{\link[base:regexec]{base::regexec}}
Arguments passed on to \code{\link[base:grep]{base::regexec}}
\describe{
\item{\code{ignore.case}}{if \code{FALSE}, the pattern matching is \emph{case
sensitive} and if \code{TRUE}, case is ignored during matching.}
@@ -52,6 +52,5 @@ the RStudio viewer pane. If \code{render} is \code{FALSE}, the HTML itself is re
If the output is destined for a \link{knitr} document, set \code{knitr} to \code{TRUE}.
}
\examples{
view_regex("example", "amp", render=FALSE)

view_regex("example", "amp", render = FALSE)
}

Ładowanie…
Anuluj
Zapisz