hudkit-code-editor

0.0.3 • Public • Published

hudkit-ace-editor

A code editor widget for hudkit, based on ACE.

Installation

hudkit-ace-editor lists hudkit as a peerDependency, so:

$ npm install hudkit
$ npm install hudkit-ace-editor
$ cp -R node_modules/hudkit-ace-editor/ace-editor $ASSETS

Substitute $ASSETS with the directory from which your assets are served. Your HTML needs to include something like this:

<script src='$ASSETS/ace-editor/ace.js'></script>

Initialisation

Assuming a browserify workflow, you can initialise the editor like this:

var hudkit = require('hudkit');
 
// requiring the module will automatically register it with hudkit
require('hudkit-ace-editor');
 
window.init = function() {
    var hk = hudkit.instance(window);
    var codeEditor = hk.aceEditor();
    hk.root.setRootWidget(codeEditor);
}

See demo/index.htm, demo/main.js and the Makefile for a concrete build example.

Readme

Keywords

Package Sidebar

Install

npm i hudkit-code-editor

Weekly Downloads

3

Version

0.0.3

License

ISC

Last publish

Collaborators

  • jaz303