Markdown editor as htmlwidget?


#1

Hi all,

Does anyone know of a markdown editor as a htmlwidget that I could use in a shiny app as a replacement for textAreaInput? This would be a pretty powerful combination with parameterized reports.

I found an MIT licensed javascript library (SimpleMDE) that can act in such a manner but am not clear how best to use it with Shiny or if there is better alternative.

Thanks

Iain


#2

Not sure if this package (https://github.com/trestletech/shinyAce) fits what you’re looking for?


#3

Thanks, but not quite, I think that is aimed for syntax highlighting of code rather than markdown.

I am looking for an editor with a toolbar that will make it easier for beginners/non-experts to create markdown formatted text. My aim is to let users create blocks of text that can be stored in a database and latter rendered by RMarkdown into a report.

I found an editor that is based on bootstrap and Ace (here) which might be a good fit


#4

Hmm, I see. A long long time ago, I used code from knitr to create a simple Shiny app, that is basically a live markdown editor (see: https://github.com/bborgesr/shiny_apps). You can try it out with shiny::runGitHub("shiny_apps", "bborgesr", subdir = "rmd"): the first thing it does is ask you to open a (.md or .Rmd file), then it displays a live markdown editor using that file as a starting point. As is, it’s not saving anything, so it’s not practical to use as an actual editor where you could save stuff (though that functionality shouldn’t be difficult to add, though it’s not a one-liner either). I suppose you can fork and build on that if you’d like, but it’s a little old! :confused: Good luck with whatever you end up choosing, sounds like a cool project!


#5

Very useful! Thanks for the tips, it is certainly enough to get me started :slight_smile: