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">
$ edjangerabout
_ _
___ __| |(_) __ _ _ __ __ _ ___ _ __
/ _ \/ _` || |/ _` | '_ \ / _` |/ _ \ '__|
| __/ (_| || | (_| | | | | (_| | __/ |
\___|\__,_|/ |\__,_|_| |_|\__, |\___|_|
|__/ |___/
Licence: The MIT License (MIT)
Copyright (c) 2016 copyright pamtrak06@gmail.com
</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
});
});