Vaheed01
Vaheed01

Reputation: 1057

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?

Upvotes: 13

Views: 13202

Answers (1)

Jos&#233; dB.
Jos&#233; dB.

Reputation: 449

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" />

Upvotes: 18

Related Questions