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: 3 months ago
JSON representation
ABAP mode for CodeMirror
- Host: GitHub
- URL: https://github.com/larshp/codemirror-abap
- Owner: larshp
- License: mit
- Created: 2016-03-12T11:25:00.000Z (almost 9 years ago)
- Default Branch: main
- Last Pushed: 2023-03-14T21:55:21.000Z (almost 2 years ago)
- Last Synced: 2024-11-02T10:11:29.464Z (3 months ago)
- Topics: codemirror
- Language: TypeScript
- Homepage:
- Size: 769 KB
- Stars: 8
- Watchers: 6
- Forks: 5
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-codemirror5 - ABAP
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