ianwalter / codemirror-mode-elixir

A CodeMirror mode for the Elixir language
https://codemirror-mode-elixir.optick.io
MIT License
22 stars 5 forks source link
codemirror-mode elixir

codemirror-mode-elixir

A CodeMirror mode for the Elixir language

Installation

npm install codemirror codemirror-mode-elixir --save

Usage

  1. Include codemirror-mode-elixir into your project.

    <!-- You can simply add elixir.js as a script tag: -->
    <script src="https://github.com/ianwalter/codemirror-mode-elixir/raw/master/js/codemirror.js"></script>
    <script src="https://github.com/ianwalter/codemirror-mode-elixir/raw/master/js/codemirror-mode-elixir/dist/elixir.js"></script>

    or

    // If you're using frontend build tools like Webpack and Babel,
    // you can simply import the module and register the mode:
    import CodeMirror from 'codemirror'
    import registerElixirMode from 'codemirror-mode-elixir'
  2. Set 'elixir' as the mode when creating the CodeMirror editor.

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

License

MIT - See LICENSE

 

Created by Ian Walter