0.2.4 • Published 2 years ago

codemirror-abap v0.2.4

Weekly downloads
14
License
MIT
Repository
github
Last release
2 years ago

NPM Version Github Actions Codecov

Description

Add ABAP syntax highlighting to the CodeMirror editor.

Installation

npm install --save codemirror-abap

Usage

Build tools

  1. Import codemirror-abap in your project.

    import CodeMirror from 'codemirror';
    // mode and MIME type are registered automatically
    import 'codemirror-abap';

    or

    import CodeMirror from 'codemirror';
    import { abapMode } from 'codemirror-abap';
    
    // explicitly register mode
    CodeMirror.defineMode("abap", abapMode);
  2. Set 'abap' as the mode when instantiating the CodeMirror editor.

    CodeMirror.fromTextArea(element, {
        mode: 'abap'
    });

Browser

  1. Include the codemirror-abap bundle in a script tag.

    <!-- CodeMirror is a peer dependency -->
    <script src="js/codemirror.js"></script>
    <!-- mode and MIME type are registered automatically  -->
    <script src="js/codemirror-abap/bundles/abap.min.js"></script>

    or

    <script src="js/codemirror.js"></script>
    <script src="js/codemirror-abap/bundles/abap.min.js"></script>
    
    <!-- explicitly register mode  -->
    CodeMirror.defineMode("abap", abap.abapMode);
  2. Set 'abap' as the mode when instantiating the CodeMirror editor.

    CodeMirror.fromTextArea(element, {
        mode: 'abap'
    });

CDN

<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.57.0/codemirror.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror-abap/bundles/abap.min.js"></script>

Demo

There's a simple React demo using react-codemirror2 in the demo directory of the git repo. To run the demo:

git clone https://github.com/larshp/codemirror-abap.git
cd codemirror-abap/demo
npm install
npm start
0.2.4

2 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.1.10

4 years ago

0.2.0

4 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago