Setup
=====

Include the main CodeMirror JavaScript in the HTML source:

    <script src="<path_to>/codemirror.js"></script>

Add the class `qfq-codemirror` to a `<textarea>` element. This class marks the element to be processed by `QfqNS
.Helper.codemirror()`.

Configuration
=============

Set the `data-config` attribute on the `<textarea>` element. The value has to be valid JSON. It will then be 
deserialized and passed to CodeMirror during initialization. E.g.
 
 
    <textarea class="qfq-codemirror" data-config='{ "mode": "text/x-sql", "lineNumbers": true }'></textarea>
    
Refer to the [CodeMirror manual](https://codemirror.net/doc/manual.html) under section "Configuration" for possible 
configuration options. 

Mode
====

The configuration option `mode` sets the mode to be used by CodeMirror. To work properly, the corresponding 
JavaScript file has to be loaded. For instance, `mode: "text/x-sql"` requires to include `code-mirror-mode/sql/sql.js`

    <script src="<path_to>/code-mirror-mode/sql/sql.js"></script>
    
Currently, only SQL mode is supported. Support for additional modes can be enabled by adjusting `Gruntfile.js`.