Skip to content

Instantly share code, notes, and snippets.

@dimart
Created March 25, 2017 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimart/2533c958769a6354ad7cdc6146c68a81 to your computer and use it in GitHub Desktop.
Save dimart/2533c958769a6354ad7cdc6146c68a81 to your computer and use it in GitHub Desktop.
basic monaco example
<!DOCTYPE html>
<html>
<head></head>
<body>
<div id="container" style="width:800px;height:600px;border:1px solid grey"></div>
<script src="monaco-editor/min/vs/loader.js"></script>
<script>
require.config({ paths: { 'vs': 'monaco-editor/min/vs' }});
require(['vs/editor/editor.main'], function() {
var editor = monaco.editor.create(document.getElementById('container'), {
value: [
'function x() {',
'\tconsole.log("Hello world!");',
'}'
].join('\n'),
language: 'javascript'
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment