codemirror-nsis
v0.12.0
Published
NSIS mode for CodeMirror 5
Downloads
53
Maintainers
Readme
codemirror-nsis
A mode for NSIS to use with CodeMirror, the versatile text editor implemented in JavaScript for the browser.
Installation
Use your preferred Node package manager to install the mode
$ yarn add codemirror-nsis || npm install codemirror-nsis
Alternatively, you can clone this repository
$ git clone https://github.com/idleberg/codemirror-nsis
Usage
Example usage on website
<!DOCTYPE html>
<html>
<head>
<!-- Import CodeMirror styles -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codemirror@5/lib/codemirror.min.css">
<head>
</head>
<body>
<!-- Add Textarea -->
<textarea id="editor"></textarea>
<!-- Import CodeMirror library -->
<script defer src="https://cdn.jsdelivr.net/npm/codemirror@5/lib/codemirror.min.js"></script>
<!-- Import NSIS mode -->
<script defer type="module" src="https://cdn.jsdelivr.net/npm/codemirror-nsis@latest/dist/codemirror-nsis.mjs"></script>
<!-- Initialize CodeMirror -->
<script type="text/javascript">
const editor = document.getElementById('editor');
const options = {
lineNumbers: true,
mode: 'nsis'
};
CodeMirror.fromTextArea(editor, options);
</script>
</body>
</html>
Note: If you want to load CodeMirror from a CDN, make sure to specify a specific version for better performance – the example above doesn't to keep it simple.
License
Released under The MIT License