Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/StyraInc/codemirror-rego
A basic rego mode for CodeMirror and the base key-map that we use in our product.
https://github.com/StyraInc/codemirror-rego
Last synced: about 2 months ago
JSON representation
A basic rego mode for CodeMirror and the base key-map that we use in our product.
- Host: GitHub
- URL: https://github.com/StyraInc/codemirror-rego
- Owner: StyraInc
- License: apache-2.0
- Created: 2019-08-05T23:17:46.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-10-19T18:52:04.000Z (about 1 year ago)
- Last Synced: 2024-11-14T23:04:36.026Z (about 2 months ago)
- Language: JavaScript
- Size: 286 KB
- Stars: 4
- Watchers: 11
- Forks: 5
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-opa - CodeMirror - Rego mode and minimal key map for [CodeMirror](https://codemirror.net/) (IDE and Editor Integrations / Datasource Integrations Blogs and Articles)
README
# Rego Codemirror Addons
Rego mode and minimal key map for CodeMirror that we use at Styra.
## Usage
Simply import either the mode, key map, or both after importing CodeMirror. The key map also requires some additional addons to be imported first:
```javascript
import CodeMirror from 'codemirror'// Other CodeMirror addons...
import 'codemirror-rego/mode' // You can now use mode: 'rego'
// and/or
import 'codemirror/addon/comment/comment'
import 'codemirror/addon/edit/matchbrackets'
import 'codemirror-rego/key-map' // You can now use keyMap: 'styra'
```## Development
First run `npm install` in the project root directory to ensure all dependencies are fetched and the project is built.
Next, you may run `webpack` in the `hack` directory. This will build a version of the Node module adapted for web browsers
(found in the `hack/dist` directory). Once that is done, open the `hack/index.html` file in your browser of choice, and you
should see an instance of the CodeMirror editor, with syntax highlighting enabled for Rego.## Community
For questions, discussions and announcements related to Styra products, services and open source projects, please join the Styra community on [Slack](https://join.slack.com/t/styracommunity/shared_invite/zt-1p81qz8g4-t2OLKbvw0J5ibdcNc62~6Q)!