您好,欢迎访问一九零五行业门户网

monaco-editor:基于浏览器的代码编辑器_html/css_WEB-ITnose

monaco editor the monaco editor is the code editor that powersvs code, a good page describing the code editor's features is here .
issues please mention the version of the editor when creating issues and the browser you're having trouble in.
this repository contains only the scripts to glue things together, please create issues against the actual repositories where the source code lives:
monaco-editor-core:issues -- npm module (issues with the editor itself) monaco-typescript:issues -- npm module (issues with javascript or typescript language support) monaco-languages:issues -- npm module (issues with bat, coffee script, cpp, csharp, fsharp, go, ini, jade, lua, objective-c, powershell, python, r, ruby, sql, swift, vb or xml) known issues in ie, the editor must be completely surrounded in the body element, otherwise the hit testing we do for mouse operations does not work. you can inspect this using f12 and clicking on the body element and confirm that visually it surrounds the editor.
installing npm install monaco-editor
you will get:
inside dev : bundled, not minified inside min : bundled, and minified inside min-maps : source maps for min monaco.d.ts : this specifies the api of the editor (this is what is actually versioned, everything else is considered private and might break with any release). it is recommended to develop against the dev version, and in production to use the min version.
integrate here is the most basic html page that embeds the editor. more samples are available at monaco-editor-samples .

integrate cross domain if you are hosting your .js on a different domain (e.g. on a cdn) than the html, you should know that the monaco editor creates web workers for smart language features. cross-domain web workers are not allowed, but here is how you can proxy their loading and get them to work:

documentation please program against the api described in monaco.d.ts .
see the editor in action here .
find full html sampleshere.
explore api samples here .
create a monarch tokenizer here .
faq
q: what is the relationship between vs code and the monaco editor?
a: the monaco editor is generated straight from vs code's sources with some shims around services the code needs to make it run in a web browser outside of its home.
q: what is the relationship between vs code's version and the monaco editor's version?
a: none. the monaco editor is a library and it reflects directly the source code.
q: i've written an extension for vs code, will it work on the monaco editor in a browser?
a: no.
q: why all these web workers and why should i care?
a: language services create web workers to compute heavy stuff outside the ui thread. they cost hardly anything in terms of resource overhead and you shouldn't worry too much about them, as long as you get them to work (see above the cross-domain case).
q: what is this loader.js ? can i use require.js ?
a: it is an amd loader that we use in vs code. yes.
dev cheat sheet simpleserver with npm run simpleserver release with npm run release website with npm run website running monaco-editor-core from source clone https://github.com/microsoft/vscode in $/src/vscode/ (next to this repo) run $/src/vscode> gulp watch run $/src/monaco-editor> npm run simpleserver edit $/src/monaco-editor/test/index.html and set var run_editor_from_source = true; open http://localhost:8080/monaco-editor/test/ running a plugin (e.g. monaco-typescript) from source clone https://github.com/microsoft/monaco-typescript in $/src/monaco-typescript (next to this repo) run $/src/monaco-typescript> npm run watch run $/src/monaco-editor> npm run simpleserver edit $/src/monaco-editor/test/index.html and set run_plugins_from_source['monaco-typescript'] = true; open http://localhost:8080/monaco-editor/test/ shipping a new monaco-editor version ship a new monaco-editor-core version (if necessary) bump version in https://github.com/microsoft/vscode/blob/master/build/monaco/package.json if there is a breaking api change, bump the major (or the minor for 0.x.y) push all local changes to the remote generate npm package $/src/vscode> gulp editor-distro publish npm package $/src/vscode/out-monaco-editor-core> npm publish adopt new monaco-editor-core in plugins (if necessary) https://github.com/microsoft/monaco-typescript https://github.com/microsoft/monaco-languages adopt new monaco-editor-core edit $/src/monaco-editor/package.json and update the version for (as necessary): monaco-editor-core monaco-typescript monaco-languages update the version in $/src/monaco-editor/package.json i try to keep it similar to monaco-editor-core , maybe just vary the patch version. fetch latest deps by running $/src/monaco-editor> npm install . package monaco-editor run $/src/monaco-editor> npm run release try out packaged bits open http://localhost:8080/monaco-editor/test/index-release.html open http://localhost:8080/monaco-editor/test/smoketest-release.html publish packaged bits run $/src/monaco-editor/release> npm publish running the website from its source run $/src/monaco-editor> npm run release open http://localhost:8080/monaco-editor/website/ generating the playground samples edit $/src/monaco-editor/website/playground/playground.mdoc run $/src/monaco-editor> gulp playground-samples publishing the website run $/src/monaco-editor> npm run website force-push the gh-pages branch: $/src/monaco-editor-website> git push origin gh-pages --force license mit
其它类似信息

推荐信息