Codemirror -extrakeys

by jean-philippe janecek

HTML

<link rel="stylesheet" href="https://codemirror.net/theme/ambiance.css">
<script src="https://codemirror.net/lib/codemirror.js"></script>
<link rel="stylesheet" href="https://codemirror.net/lib/codemirror.css">
<script src="https://codemirror.net/3/mode/shell/shell.js"></script>
<form>
  <textarea id="code" name="code">
$ edjangercheck 
Check edjanger.properties...
> Check configuration variables from edjanger.properties...
  . check "cron_start"
  . check "cron_build"
  . check "docker_command"
  . check "image_name"
  . check "build_path"
  . check "build_file"
  . check "build_options"
  . check "container_name"
  . check "container_hostname"
    WARNING: parameter is missing !!!
  . check "exposed_ports"
  . check "shared_volumes"
  . check "environment_variables"
    WARNING: parameter is missing !!!
  => STATUS of configuration is: some parameters are undefined
  </textarea>
</form>

CSS

.CodeMirror {
  border: 1px solid #eee;
  height: auto;
}

JavaScript

$(document).ready(function() {
  var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
    mode: 'shell',
    theme: "ambiance",
    lineNumbers: true,
    matchBrackets: true
  });
});