Description Usage Arguments Value Server value Examples
View source: R/shinymarkdown.R
Create an instance of a Markdown editor for text that may require formatting.
1 2 3 4 5 6 7 8 9 10 11 |
inputId |
The |
min_height |
The editor's miniminum height value (pixels). Default = '300px'. Overwritten by the height parameter. |
height |
The editor's height value, applied as a border-box. Example values include "300px", "100%", and "auto". Defaults to "500px". |
preview_style |
The Markdown editor's preview style. Either "tab" or "vertical". Default is "tab". |
preview_highlight |
Should the Markdown Editor's HTML preview have a highlighted element corresponding to the cursor position in the Markdown editor. Default is FALSE. |
initial_edit_type |
Initial editor type: "markdown" or "wysiwyg". Default is "markdown". |
hide_mode_switch |
Should the user be able to switch the editor mode from "wysiwyg" to "markdown" or vice versa? Default is TRUE. |
language |
Editor language ISO code. Defaults to "en-us". |
initial_value |
Should the editor have text already present? If so, supply a character string. Default is NULL. |
An instance of the markdown editor for use within a Shiny App.
A character string of the text input in two formats:
Markdown, which may be accessed using the inputId with "_markdown" as a suffix.
HTML, which may be accessed using the inputId with "_html" as a suffix.
See the examples section for more an example.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | if(interactive()) {
library(shiny)
library(shinymarkdown)
ui <- fluidPage(
mdInput(inputId = "myEditor", height = "500px", hide_mode_switch = F)
)
server <- function(input, output, session) {
# Print the markdown version of what is typed
observe({print(input$myEditor_markdown)})
# Print the HTML version of what is typed
observe({print(input$myEditor_html)})
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.