inst/builtin-templates/bslib-bare/modules/card/R/aaa.R

library(shiny)
library(shidashi)

card_with_code <- function(expr, env = parent.frame(),
                           class = "height-50", width.cutoff = 25L) {
  expr <- substitute(expr)
  x <- eval(expr, envir = env)

  code <- clipboardOutput(
    clip_text = format_text_r(
      get_construct_string(x), quoted = TRUE,
      width.cutoff = width.cutoff
    ), class = "float-end", as_card_tool = TRUE
  )
  expr[["footer"]] <- code
  eval(expr, envir = env)
}

Try the shidashi package in your browser

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

shidashi documentation built on April 10, 2026, 5:07 p.m.