For the first time I'm trying to use CodeMirror for template edition of my CMS. In the first page of 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?
For the first time I'm trying to use CodeMirror for template edition of my CMS. In the first page of http://codemirror 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?
- 8 Click download on the CodeMirror website's homepage. It's on the red part of the yin-yang symbol. – Joe Clay Commented Feb 24, 2017 at 16:54
- Thanks you, It seems I should be waiting for down votes for my post! – Vaheed01 Commented Feb 24, 2017 at 16:58
- 2 No problem, something about the design of that page makes it really easy to glance past the download link... – Joe Clay Commented Feb 24, 2017 at 17:00
- 2 this post helped me too. – Cledson Araújo Commented Mar 30, 2017 at 20:08
1 Answer
Reset to default 18One way to get CodeMirror is to download it. You can get the file links from the CDN here: https://cdnjs./libraries/codemirror
You just have to put the CDN link in the script
or link
tag like this:
<script src="https://cdnjs.cloudflare./ajax/libs/codemirror/5.32.0/codemirror.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare./ajax/libs/codemirror/5.32.0/codemirror.min.css" />