prismDependencies: PrismJS source tags

Description Usage Arguments Value Examples

Description

PrismJS source tags

Usage

1
prismDependencies(language = "r", theme = "coy")

Arguments

language

what programming language for syntax highlighting

theme

what color theme to use

Value

a source header loading prism from cdn

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Not run: 
library(shiny)

ui <- fluidPage(
  prismDependencies('r', 'coy'),
  clipboardjsDependencies(),
  selectInput('x', 'x axis', choices = names(mtcars)),
  selectInput('y', 'y axis', choices = names(mtcars)),
  actionButton("show_code", "Show R Code", icon("code")),
  plotOutput('plot')
)

srv <- function(input, output, session) {
  output$plot <- renderPlot({
    plot(x = mtcars[[input$x]],
         y = mtcars[[input$y]])
  })
  observeEvent(input$show_code, {
    show_code_modal(srv)
  })
}

shinyApp(ui, srv)

## End(Not run)

dgkf/scriptgloss documentation built on June 8, 2019, 8:43 p.m.