/codemirror-mode-zenscript

A CodeMirror mode for the ZenScript language

Primary LanguageJavaScriptMIT LicenseMIT

codemirror-mode-zenscript

npm version dependencies Status

A CodeMirror mode for ZenScript

Installation

npm install codemirror codemirror-mode-zenscript --save

Usage

  1. 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';
  2. Set zenscript as the mode when creating the CodeMirror editor.

    CodeMirror.fromTextArea(document.getElementById('code'), {mode: 'zenscript'});