how can I add some texts into markdown editor?
Opened this issue · 1 comments
skyrealman commented
for example, click a button and then add some texts into shinymarkdown editor?
jcrodriguez1989 commented
Hi @skyrealman ,
I needed to add a markdown input to my Shiny app, and found this great package. Unfortunately, it seems to be no longer maintained, so I forked it and placed some updates. You can find the {shinymarkdown}
I am working on at https://github.com/jcrodriguez1989/shinymarkdown/ where I added the updateMarkdownEditorInput
function which might solve your needs.
Install the package with remotes::install_github("jcrodriguez1989/shinymarkdown")
.
And here's an example of the updateMarkdownEditorInput
function:
library(shiny)
library(shinymarkdown)
ui <- fluidPage(
useShinyMarkdownEditor(),
actionButton("reset", "Reset"),
markdownEditorInput(inputId = "editor")
)
server <- function(input, output, session) {
observeEvent(input$reset, updateMarkdownEditorInput(session, "editor", ""))
}
shinyApp(ui, server)