Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 1.21 KB

README.md

File metadata and controls

37 lines (27 loc) · 1.21 KB

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'});