Просмотр исходного кода

Drop empty templates, show source, allow HTML in description

tags/v0.2.0
Garrick Aden-Buie 8 лет назад
Родитель
Сommit
84ca893558
1 измененных файлов: 8 добавлений и 5 удалений
  1. +8
    -5
      R/regex_gadget.R

+ 8
- 5
R/regex_gadget.R Просмотреть файл



output$template_info <- renderUI({ output$template_info <- renderUI({
req(this_template()) req(this_template())
tt <- this_template()
rx_url <- "((https?|ftp|file)://)?([[:alnum:].-]+)\\.([a-zA-Z.]{2,6})([/[[:alpha:].-]*)*/?"
tagList( tagList(
tags$h5("Description"), tags$h5("Description"),
tags$p(this_template()$description),
tags$p(HTML(tt$description)),
tags$h5("Pattern"), tags$h5("Pattern"),
tags$pre(
tags$code(
this_template()$regex
)
tags$pre(tags$code(tt$regex)),
if (!is.null(tt$source)) tags$p(
"Source:",
if (grepl(rx_url, tt$source)) tags$a(href = tt$source, tt$source) else tt$source
) )
) )
}) })
simplifyDataFrame = FALSE, simplifyDataFrame = FALSE,
simplifyMatrix = FALSE simplifyMatrix = FALSE
) )
patterns <- purrr::keep(patterns, ~ .$name != "")
patterns[order(purrr::map_chr(patterns, 'name'))] patterns[order(purrr::map_chr(patterns, 'name'))]
} }

Загрузка…
Отмена
Сохранить