Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/wisersolutions/aor-codemirror
- Owner: WiserSolutions
- License: isc
- Created: 2018-09-14T18:22:01.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-18T20:17:09.000Z (over 1 year ago)
- Last Synced: 2024-04-14T04:48:45.753Z (7 months ago)
- Language: JavaScript
- Size: 880 KB
- Stars: 1
- Watchers: 38
- Forks: 3
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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'```