Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/wisersolutions/aor-codemirror

CodeMirror wrapper for Admin On Rest
https://github.com/wisersolutions/aor-codemirror

Last synced: 3 days ago
JSON representation

CodeMirror wrapper for Admin On Rest

Awesome Lists containing this project

README

        

# Admin on Rest - CodeMirror

[![CircleCI](https://circleci.com/gh/WisePricer/aor-codemirror.svg?style=svg&circle-token=d8324b2c596c0982d37077984e2c6840b2ef2154)](https://circleci.com/gh/WiserSolutions/aor-codemirror)
[![Maintainability](https://api.codeclimate.com/v1/badges/caf521533ef41d49142c/maintainability)](https://codeclimate.com/github/WisePricer/aor-codemirror/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/caf521533ef41d49142c/test_coverage)](https://codeclimate.com/github/WisePricer/aor-codemirror/test_coverage)

Wrapper around [CodeMirror](https://codemirror.net) for [react-admin](https://marmelab.com/react-admin/).

Supported formats:

* html
* json
* sql
* javascript

### Install

Install using npm: `npm install @wisersolutions/aor-codemirror`

## Usage

The prop `name` will be mapped to `source` for react-admin.

#### JSON editor

We should to turn on validation for JSON.

```jsx harmony
import { CodeMirror, validJson } from 'aor-codemirror'

```

> Output from the CodeMirrror will be JSON object (not string);

#### SQL editor

```jsx harmony
import { CodeMirror } from 'aor-codemirror'

```

#### HTML editor

```jsx harmony
import { required } from 'react-admin'
import { CodeMirror } from 'aor-codemirror'

```
#### Javascript editor

```jsx harmony
import { required } from 'react-admin'
import { CodeMirror } from 'aor-codemirror'

```