I have used code mirror to have syntax highlighting on “xml” editor, however, I am trying to implement SQL code highlighting by using these examples. [Example 1][1] and [Example 2][2]
I have used a text area and script as shown below:
<script type="text/javascript" src="/Users/userName/Desktop/codemirror-5.9/lib/codemirror.js"></script>
<textarea id="editor">
Select * from random_table;
</textarea>
<script text="text/javascript">
var editor = CodeMirror.fromTextArea(document.getElementById("editor"), {
lineNumbers: true,
height: "450px",
parserfile: "/Users/userName/Desktop/codemirror-5.9/contrib/sql/js/parsesql.js",
stylesheet: "/Users/userName/Desktop/codemirror-5.9/css/sqlcolors.css",
path: "/Users/userName/Desktop/codemirror-5.9/lib/",
textWrapping: true
});
</script>
I have attached my file structure;
I am not sure what exactly I am missing here.Thanks for reading.
[1]: http://codemirror.net/1/contrib/sql/index.html
[2]: http://stackoverflow.com/questions/2714008/implementing-codemirror-syntax-highlighter