mad-eye / meteor-reactive-ace

31 stars 16 forks source link

meteor-reactive-ace

Quick Start

  1. Install meteorite npm install -g meteorite
  2. Clone this repo git clone git://github.com/mad-eye/meteor-reactive-ace.git; cd meteor-reactive-ace
  3. Update submodules git submodule update --init ace-builds
  4. Check out the helloAce example
    1. cd examples/helloAce
    2. mrt

Including in your project

Setup

  1. Add reactive-ace to your smart.json file
  2. Create a div element with an id where you will attach the editor. Wrap it inside of a {{constant}} block so that it is not rerendered.
  3. Create an editor object by calling new ReactiveAce()
  4. Attach the editor to the div by calling editorObject.attach(divElementId)

Enabling syntax modes and themes

Assuming your editor is a variabled named editor, try editor.theme = "monokai" editor.syntaxMode = "javascript"

Full list of themes and modes

Turning on the javascript abstract syntax tree

(powered by esprima)

  1. Turn on abstract syntax tree parsing with editor.parseEnabled = true
  2. View it with editor.parsedBody
  3. If you have an error in your javascript editor.parsedError will be populated.