Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moroboxai/moroboxai-editor-web
Embeddable code editor for coding AIs for MoroboxAI on the web
https://github.com/moroboxai/moroboxai-editor-web
code-editor javascript library moroboxai typescript
Last synced: about 2 months ago
JSON representation
Embeddable code editor for coding AIs for MoroboxAI on the web
- Host: GitHub
- URL: https://github.com/moroboxai/moroboxai-editor-web
- Owner: moroboxai
- License: mit
- Created: 2022-04-21T06:36:17.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-11-01T07:49:02.000Z (about 1 year ago)
- Last Synced: 2024-10-10T18:13:59.152Z (3 months ago)
- Topics: code-editor, javascript, library, moroboxai, typescript
- Language: TypeScript
- Homepage:
- Size: 1.58 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# moroboxai-editor-web
[![NPM version](https://img.shields.io/npm/v/moroboxai-editor-web.svg)](https://www.npmjs.com/package/moroboxai-editor-web)
![Node.js CI](https://github.com/moroboxai/moroboxai-editor-web/workflows/Node.js%20CI/badge.svg)
[![gitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/moroboxai/moroboxai-editor-web/blob/master/LICENSE)
[![Code Quality: Javascript](https://img.shields.io/lgtm/grade/javascript/g/moroboxai/moroboxai-editor-web.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/moroboxai/moroboxai-editor-web/context:javascript)
[![Total Alerts](https://img.shields.io/lgtm/alerts/g/moroboxai/moroboxai-editor-web.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/moroboxai/moroboxai-editor-web/alerts)Embeddable code editor for coding AIs for [MoroboxAI](https://github.com/moroboxai) on the web.
## Install
Using npm:
```bash
npm install moroboxai-editor-web --save
```Or:
```bash
git clone https://github.com/moroboxai/moroboxai-editor-web.git
cd moroboxai-editor-web
npm i
npm run build
```## Usage
Create a `sample.html` file in the `moroboxai-editor-web` folder:
```html
// Initialize the editor on our div
const editor = MoroboxAIEditor.init({
element: document.getElementById("editor"),
value: 'function foo() {\n console.log("foo");\n}\n',
width: "500px",
height: "400px"
});
```
Open `sample.html` in your browser and check the console output.
## Arguments
| Name | Type | Default | Description |
|:----------|:-------------|:------|:------|
| element | Element || DOM element to attach the editor to |
| language | string | javascript | Selected language |
| value | string || Initial content of the editor |
| width | string || Width of the `div` element |
| height | string || Height of the `div` element |
| onLoad | func | noop | **Signature: function(value: string) => void**
Function called when the Load button is clicked |
| onUnload | func | noop | **Signature: function() => void**
Function called when the Unload button is clicked |## License
This content is released under the [MIT](http://opensource.org/licenses/MIT) License.