JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script>
<div id="editor">function foo(items) {
var x = "All this is syntax highlighted";
return x;
}</div>
CSS
#editor {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
JavaScript
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/javascript");
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/javascript");
editor.commands.addCommands([{
name: "unfind",
bindKey: {
win: "Ctrl-F",
mac: "Command-F"
},
exec: function(editor, line) {
return false;
},
readOnly: true
}])