Browse Source

Fix #14 Add pattern parameter to regex_gadget()

pull/21/head
Garrick Aden-Buie 7 years ago
parent
commit
5e8522fcc3
2 changed files with 7 additions and 2 deletions
  1. +3
    -0
      R/regex_gadget.R
  2. +4
    -2
      man/regex_gadget.Rd

+ 3
- 0
R/regex_gadget.R View File

@@ -7,11 +7,13 @@
#' @import miniUI
#' @import shiny
#' @param text Text to explore in gadget (editable using interface)
#' @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"`
#' @export
regex_gadget <- function(
text = NULL,
pattern = NULL,
start_page = if (is.null(text)) "Text" else "RegEx"
) {
stopifnot(requireNamespace("miniUI"), requireNamespace("shiny"))
@@ -54,6 +56,7 @@ regex_gadget <- function(
fillRow(
flex = c(6, 1),
textInputCode('pattern', 'RegEx', width = "100%",
value = pattern,
placeholder = "Standard RegEx, e.g. \\w+_\\d{2,4}\\s+"),
tags$div(style = "margin-top: 23px; margin-left:6px;",
actionButton("library_show", "Library", class = "btn-success"))

+ 4
- 2
man/regex_gadget.Rd View File

@@ -4,12 +4,14 @@
\alias{regex_gadget}
\title{RegExplain gadget}
\usage{
regex_gadget(text = NULL, start_page = if (is.null(text)) "Text" else
"RegEx")
regex_gadget(text = NULL, pattern = NULL, start_page = if
(is.null(text)) "Text" else "RegEx")
}
\arguments{
\item{text}{Text to explore in gadget (editable using interface)}

\item{pattern}{Regular Expression to edit or visualize using RegExplain}

\item{start_page}{Open gadget to this tab, one of \code{"Text"}, \code{"RegEx"},
\code{"Output"}, or \code{"Help"}}
}

Loading…
Cancel
Save