Przeglądaj źródła

Edit regex input placeholder and Regex -> RegEx

tags/v0.2.0
Garrick Aden-Buie 8 lat temu
rodzic
commit
398947a73c
3 zmienionych plików z 11 dodań i 11 usunięć
  1. +1
    -1
      DESCRIPTION
  2. +8
    -8
      R/regex_gadget.R
  3. +2
    -2
      man/regex_gadget.Rd

+ 1
- 1
DESCRIPTION Wyświetl plik

Package: regexplain Package: regexplain
Title: Rstudio Addin to Explain, Test and Build Regular Expressions Title: Rstudio Addin to Explain, Test and Build Regular Expressions
Version: 0.1.5
Version: 0.1.5.9000
Date: 2018-03-14 Date: 2018-03-14
Authors@R: c( Authors@R: c(
person("Garrick", "Aden-Buie", email = "g.adenbuie@gmail.com", role = c("aut", "cre")), person("Garrick", "Aden-Buie", email = "g.adenbuie@gmail.com", role = c("aut", "cre")),

+ 8
- 8
R/regex_gadget.R Wyświetl plik

#' @import miniUI #' @import miniUI
#' @import shiny #' @import shiny
#' @param text Text to explore in gadget (editable using interface) #' @param text Text to explore in gadget (editable using interface)
#' @param start_page Open gadget to this tab, one of `"Text"`, `"Regex"`,
#' @param start_page Open gadget to this tab, one of `"Text"`, `"RegEx"`,
#' `"Output"`, or `"Help"` #' `"Output"`, or `"Help"`
#' @export #' @export
regex_gadget <- function(text = NULL, regex_gadget <- function(text = NULL,
start_page = if (is.null(text)) "Text" else "Regex") {
start_page = if (is.null(text)) "Text" else "RegEx") {
stopifnot(requireNamespace("miniUI"), requireNamespace("shiny")) stopifnot(requireNamespace("miniUI"), requireNamespace("shiny"))


update_available <- check_version() update_available <- check_version()
shiny::includeCSS(system.file("styles", "gadget.css", package = "regexplain")), shiny::includeCSS(system.file("styles", "gadget.css", package = "regexplain")),
gadgetTitleBar( gadgetTitleBar(
"regexplain", "regexplain",
right = miniTitleBarButton("done", "Send Regex To Console", TRUE)
right = miniTitleBarButton("done", "Send RegEx To Console", TRUE)
), ),
miniTabstripPanel( miniTabstripPanel(
selected = match.arg(start_page, c("Text", "Regex", "Output", "Help")),
selected = match.arg(start_page, c("Text", "RegEx", "Output", "Help")),
# --- UI - Tab - Text ---- # --- UI - Tab - Text ----
miniTabPanel( miniTabPanel(
"Text", icon = icon('file-text-o'), "Text", icon = icon('file-text-o'),
), ),
# ---- UI - Tab - Regex ---- # ---- UI - Tab - Regex ----
miniTabPanel( miniTabPanel(
"Regex", icon = icon('terminal'),
"RegEx", icon = icon('terminal'),
miniContentPanel( miniContentPanel(
fillCol( fillCol(
flex = c(1, 3), flex = c(1, 3),
fillCol( fillCol(
flex = c(1, 1), flex = c(1, 1),
textInputCode('pattern', 'Regex', width = "100%",
placeholder = "Enter regex, single \\ okay"),
textInputCode('pattern', 'RegEx', width = "100%",
placeholder = "Standard RegEx, e.g. \\w+_\\d{2,4}\\s+"),
checkboxGroupInput( checkboxGroupInput(
'regex_options', 'regex_options',
label = HTML( label = HTML(
choices = regexFn_choices), choices = regexFn_choices),
tags$span(class = "help-block", tags$span(class = "help-block",
style = "font-size:1.25rem; margin-top:-10px; margin-bottom:0px; margin-left:4px;", style = "font-size:1.25rem; margin-top:-10px; margin-bottom:0px; margin-left:4px;",
"Adjust options in Regex tab")
"Adjust options in RegEx tab")
), ),
uiOutput("output_sub") uiOutput("output_sub")
), ),

+ 2
- 2
man/regex_gadget.Rd Wyświetl plik

\title{regexplain gadget} \title{regexplain gadget}
\usage{ \usage{
regex_gadget(text = NULL, start_page = if (is.null(text)) "Text" else regex_gadget(text = NULL, start_page = if (is.null(text)) "Text" else
"Regex")
"RegEx")
} }
\arguments{ \arguments{
\item{text}{Text to explore in gadget (editable using interface)} \item{text}{Text to explore in gadget (editable using interface)}


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

Ładowanie…
Anuluj
Zapisz