For the first time I'm trying to use CodeMirror for template edition of my CMS. In the first page of http://codemirror.net there is the following sample:
<link rel="stylesheet" href="lib/codemirror.css">
<script src="lib/codemirror.js"></script>
<script>
var editor = CodeMirror.fromTextArea(myTextarea, {
lineNumbers: true
});
</script>
But on the GitHub page there isn't any codemirror.js file in the lib
directory. How should I use this tool?
One way to get CodeMirror is to download it. You can get the file links from the CDN here: https://cdnjs.com/libraries/codemirror
You just have to put the CDN link in the script
or link
tag like this:
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.32.0/codemirror.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.32.0/codemirror.min.css" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With