Output and render functions for using editor()
within Shiny
applications and interactive Rmd documents.
Usage
editorOutput(outputId, width = "100%", height = "600px")
renderEditor(expr, env = parent.frame(), quoted = FALSE)
Arguments
- outputId
Output variable to read from.
- width, height
Must be a valid CSS unit (like
100%
,400px
,auto
) or a number, which will be coerced to a string and havepx
appended.- expr
An expression that generates a calendar
- env
The environment in which to evaluate
expr
.- quoted
Is
expr
a quoted expression (withquote()
)? This is useful if you want to save an expression in a variable.
Examples
library(shiny)
library(toastui)
ui <- fluidPage(
tags$h2("editor shiny example"),
tabsetPanel(
tabPanel(
title = "Default",
editorOutput("default"),
tags$b("CHECK HEIGHT")
),
tabPanel(
title = "WYSIWYG",
editorOutput("wysiwyg"),
tags$b("CHECK HEIGHT")
),
tabPanel(
title = "Vertical",
editorOutput("vertical"),
tags$b("CHECK HEIGHT")
)
)
)
server <- function(input, output, session) {
output$default <- renderEditor({
editor(minHeight = "400px")
})
output$wysiwyg <- renderEditor({
editor(initialEditType = "wysiwyg", hideModeSwitch = TRUE)
})
output$vertical <- renderEditor({
editor(previewStyle = "vertical")
})
}
if (interactive())
shinyApp(ui, server)