The 'Monaco' Editor as a HTML Widget

A HTML widget rendering the 'Monaco' editor. The 'Monaco' editor is the code editor which powers 'VS Code'. It is particularly well developed for 'JavaScript'. In addition to the built-in features of the 'Monaco' editor, the widget allows to prettify multiple languages, to view the 'HTML' rendering of 'Markdown' code, and to view and resize 'SVG' images.


monaco: the Monaco editor as a HTML widget

Yet another second editor in RStudio.

The Monaco editor is the code editor which powers 'VS Code'. It is particularly well developed for JavaScript. In addition to the built-in features of the Monaco editor, the widget allows to prettify multiple languages, to view the HTML rendering of Markdown code, and to view and resize SVG images.

With the help of htmltools::browsable, one can open two Monaco editors in the RStudio viewer pane:

The Monaco editor has many options. If you would like some of them to be available in the monaco package, please fill an issue.

As any HTML widget, the Monaco editor widget can be used in Shiny apps:

This app uses the sass package to compile some SCSS code to CSS code. It is one of the examples provided in the monaco package.

Related projects

  • shinyMonacoEditor: the Monaco editor in a sophisticated Shiny app. It is more developed than the monaco widget but using the Shiny app locks RStudio.
  • aceEditor: the Ace editor as a HTML widget.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("monaco")

0.2.2 by Stéphane Laurent, 4 years ago


https://github.com/stla/monaco


Report a bug at https://github.com/stla/monaco/issues


Browse source code at https://github.com/cran/monaco


Authors: Stéphane Laurent [aut, cre] , Microsoft Corporation [ctb, cph] ('Monaco Editor' library) , James Long and contributors [ctb, cph] ('Prettier' library) , Rich Harris [ctb, cph] ('svg-parser' library) , Lionel Tzatzkin [ctb, cph] ('scale-that-svg' library) , Andrei Kashcha [ctb, cph] ('panzoom' library) , Vitaly Puzrin [ctb, cph] ('markdown-it' library) , Alex Kocharin [ctb, cph] ('markdown-it' library) , John Schlinkert [ctb, cph] ('word-wrap' library) , jQuery contributors [ctb, cph] ('jQuery' library) , Kyle Fox [ctb, cph] ('jQuery Modal' library) , Tristan Edwards [ctb, cph] ('sweetalert2' library) , Limon Monte [ctb, cph] ('sweetalert2' library)


Documentation:   PDF Manual  


GPL-3 license


Imports htmlwidgets, rstudioapi, tools, htmltools, shiny

Suggests sass


See at CRAN