codemirror-mode-zenscript
v1.0.7
Published
A CodeMirror mode for the ZenScript language
Downloads
37
Readme
codemirror-mode-zenscript
A CodeMirror mode for ZenScript
Installation
npm install codemirror codemirror-mode-zenscript --save
Usage
Include
codemirror-mode-zenscript
into your project.<!-- You can simply add zenscript.js as a script tag: --> <script src="js/codemirror.js"></script> <script src="js/codemirror-mode-zenscript/dist/codemirror-mode-zenscript.js"></script>
or
// If using a build pipeline like webpack, you can simply import the module. // The mode is registered automatically when importing. See below: import CodeMirror from 'codemirror'; import registerZenScriptMode from 'codemirror-mode-zenscript';
Set
zenscript
as the mode when creating the CodeMirror editor.CodeMirror.fromTextArea(document.getElementById('code'), {mode: 'zenscript'});