R/application.R

### ----------------------------------------------------------------- ###
### METHODS USED IN SHINY APPLICATION ----
### ----------------------------------------------------------------- ###

#' Note preview in Shiny application
#' 
#' Converts text with markdown tags into text with HTML tags.
#' 
#' @param text input text.
#' @importFrom commonmark markdown_html
#' @export
note_preview <- function(input) {
  
  if (!is.character(input)) 
    stop("not a character vector ", input)
  if (!length(input) == 1L)
    stop("length vector should be one ", input)
  
  commonmark::markdown_html(input)
}
strboul/shinyNotes documentation built on June 2, 2019, 10:56 p.m.