Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Markdown preview in the Monaco Editor?

VSCode has for .md markdown files, "Open Preview". How to get that same functionality? Is it included? I looked through the playground examples and the API, but do not see anything. Thanks.

like image 231
Chau Nguyen Avatar asked Jul 04 '18 10:07

Chau Nguyen


1 Answers

This functionality is not part of Monaco.

I wouldn't bother with trying to get the preview into Monaco itself; just grab the markdown content from the editor, pass it through a markdown rendering engine like markdown-it, and preview the generated html in a iframe or similar. See the markdown-it demo for inspiration

like image 166
Matt Bierner Avatar answered Oct 22 '22 06:10

Matt Bierner