Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/larshp/codemirror-abap

ABAP mode for CodeMirror
https://github.com/larshp/codemirror-abap

codemirror

Last synced: 6 days ago
JSON representation

ABAP mode for CodeMirror

Lists

README

        




codemirror-abap



ABAP mode for the CodeMirror editor

[![NPM Version][npm-badge]][npm-url]
[![Github Actions][gh-actions-badge]][gh-actions-url]
[![Codecov][codecov-badge]][codecov-url]

## Description

Add ABAP syntax highlighting to the [CodeMirror][codemirror-url] editor.

## Installation

``` bash
npm install --save codemirror-abap
```

## Usage

### Build tools

1. Import `codemirror-abap` in your project.

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

or

```js
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.

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

### Browser

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

```html




```

or

```html


CodeMirror.defineMode("abap", abap.abapMode);
```

2. Set 'abap' as the mode when instantiating the CodeMirror editor.

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

### CDN
```html

```

## Demo

There's a simple React demo using [react-codemirror2](https://www.npmjs.com/package/react-codemirror2) in the [demo](/demo) directory of the git repo.
To run the demo:

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

[npm-badge]: https://img.shields.io/npm/v/codemirror-abap.svg
[npm-url]: https://www.npmjs.com/package/codemirror-abap
[gh-actions-badge]: https://img.shields.io/github/workflow/status/larshp/codemirror-abap/test
[gh-actions-url]: https://github.com/larshp/codemirror-abap/actions
[codecov-badge]: https://codecov.io/gh/larshp/codemirror-abap/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/larshp/codemirror-abap
[dependency-badge]: https://david-dm.org/larshp/codemirror-abap.svg
[dependency-url]: https://david-dm.org/larshp/codemirror-abap
[codemirror-url]: https://github.com/codemirror/CodeMirror