codemirror-abap
v0.2.4
Published
ABAP mode for CodeMirror
Downloads
987
Readme
Description
Add ABAP syntax highlighting to the CodeMirror editor.
Installation
npm install --save codemirror-abap
Usage
Build tools
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);
Set 'abap' as the mode when instantiating the CodeMirror editor.
CodeMirror.fromTextArea(element, { mode: 'abap' });
Browser
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);
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