A CodeMirror mode for ZenScript
npm install codemirror codemirror-mode-zenscript --save
-
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'});