Skip to content

Instantly share code, notes, and snippets.

@junhui
Created September 24, 2013 03:42
Show Gist options
  • Select an option

  • Save junhui/6680112 to your computer and use it in GitHub Desktop.

Select an option

Save junhui/6680112 to your computer and use it in GitHub Desktop.
how to use code mirror
<link rel="stylesheet" href="codemirror-3.16/lib/codemirror.css">
<link href="codemirror-3.16/theme/elegant.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
.CodeMirror {
height: 100%
}
.CodeMirror-scroll {
overflow-y: hidden;
overflow-x: auto;
}
</style>
<script src="codemirror-3.16/lib/codemirror.js"></script>
<script src="codemirror-3.16/mode/xml/xml.js"></script>
<script src="codemirror-3.16/mode/javascript/javascript.js"></script>
<script src="codemirror-3.16/mode/css/css.js"></script>
<script src="codemirror-3.16/mode/htmlmixed/htmlmixed.js"></script>
<script src="codemirror-3.16/mode/htmlembedded/htmlembedded.js"></script>
<script type="text/javascript">
var editor;
$(function () {
editor = CodeMirror.fromTextArea(document.getElementById("fileoutput"), {
lineNumbers: true,
matchBrackets: true,
height: "500px",
lineWrapping: true,
indentUnit: 4,
mode: "application/x-aspx"
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment