Integrating monaco-editor

http://caloch.cn:8082/

I want to enhance one of the site that has markdown, monaco-editor is the rich code editor that is good to use,

the current integration sample is like the link, I have deleted the other versions other than the min version, and the package was installed using npm, and the min version folder is about 12M in size, to change editors, I also explored a bit:

just by empty the innerHTML of the container, and create the editor again, so, it will change the programming language. and the content can be retrieved via "editor.getModel().getLinesContent()"; and the editor content can be set via: "editor.getModel().setValue("hello world");"

留下你的评论