R/utils.R

Defines functions highlightCode rCodeContainer renderCode

highlightCode <- function(session, id) {
  session$sendCustomMessage("highlight-code", list(id = id))
}

rCodeContainer <- function(...) {
  code <- HTML(as.character(tags$code(class = "language-r", ...)))
  div(pre(code))
}

renderCode <- function(expr, env = parent.frame(), quoted = FALSE) {
  func <- NULL
  installExprFunction(expr, "func", env, quoted)
  markRenderFunction(textOutput, function() {
    paste(func(), collapse = "\n")
  })
}

Try the pipefittr package in your browser

Any scripts or data that you put into this service are public.

pipefittr documentation built on May 2, 2019, 8:28 a.m.