SQL syntax highlighting with Codemirror (#89)

This commit is contained in:
Tom Dyson 2017-11-15 02:03:00 +00:00 committed by Simon Willison
commit 8252daa4c1
4 changed files with 9677 additions and 0 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -12,6 +12,13 @@
}
</style>
{% endif %}
<script src="/-/static/codemirror-5.31.0.js"></script>
<link rel="stylesheet" href="/-/static/codemirror-5.31.0-min.css" />
<script src="/-/static/codemirror-5.31.0-sql.min.js"></script>
<style>
.CodeMirror { height: auto; border: 1px solid #ddd; }
.CodeMirror-scroll { max-height: 200px; }
</style>
{% endblock %}
{% block content %}
@ -70,4 +77,12 @@
</ul>
{% endif %}
<script>
var editor = CodeMirror.fromTextArea(document.getElementsByName("sql")[0], {
lineNumbers: true,
mode: "text/x-sql",
lineWrapping: true,
});
</script>
{% endblock %}