Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save esironal/28af776f6bd09ab8beca to your computer and use it in GitHub Desktop.
Save esironal/28af776f6bd09ab8beca to your computer and use it in GitHub Desktop.
High Performance Code Editor For The Web
<div class="title">
<h2>
Embedding Ace in Your Site
link <a href="http://ace.c9.io/#nav=about"> link</a>
</h2>
</div>
<div id="editor">
function foo(items) {
var x = "All this is syntax highlighted";
return x;
}
</div>
<script src="http://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js"></script>
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/javascript");
document.getElementById('editor').style.fontSize='16px';
div{
overflow: hidden;
}
.title{
display: block;
margin-bottom: 50px;
}
#editor {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment