Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is CodeMirror.js?

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?

like image 647
Vahid2015 Avatar asked Feb 24 '17 16:02

Vahid2015


1 Answers

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" />
like image 117
José dB. Avatar answered Oct 19 '22 00:10

José dB.