trestletech/shinyAce

Embed shinyAce editor in RMarkdown

Closed this issue · 2 comments

Hello I've been trying to figure out if it is possible to embed shinyAce in an RMarkdown document. I want to use it to display code in a scrollable way, not necessarily to allow someone to edit it. If it's possible could someone please give me an example?

vnijs commented

Yes you can. See the link below for more information. I assume you can do this with quarto as well but haven't tried that yet.

https://bookdown.org/yihui/rmarkdown/shiny-start.html

---
title: "shinyAce in Rmarkdown"
output: html_document
runtime: shiny
---

```{r}
library(shinyAce)
renderUI({
  aceEditor("test", value="x <-3\nprint(x)")
})
```

Thankyou Vincent.