Ace (Ajax.org Cloud9 Editor) http://ace.c9.io
Find a file
2012-09-11 10:20:20 +04:00
api Add missing params 2012-08-31 16:56:28 -07:00
build@c2f3abb2ec Merge pull request #897 from ajaxorg/doc/fix_events 2012-08-30 23:09:48 +04:00
build_support Add BSD license headers 2012-09-06 22:48:34 +02:00
demo More c/obj-c updates 2012-09-11 10:20:20 +04:00
doc Tweak styles to match new Panino 2012-08-31 16:13:38 -07:00
experiments typo 2011-12-13 14:18:08 +01:00
lib/ace Add new GitHub/Chrome builds from tmtheme 2012-09-11 10:20:20 +04:00
sourcemint doc fix 2012-03-11 16:12:27 -07:00
tool Add new GitHub/Chrome builds from tmtheme 2012-09-11 10:20:20 +04:00
.gitignore Updates to c9 highlighing 2012-06-12 09:10:49 -07:00
.gitmodules update readme 2012-07-26 20:42:42 +04:00
.travis.yml added Travis config 2011-11-16 12:21:40 +01:00
ChangeLog.txt spell correction 2011-08-03 18:31:08 +02:00
index.html Change license in index.html and package.json 2012-09-08 11:44:22 +02:00
install.js Add BSD license headers 2012-09-06 22:48:34 +02:00
kitchen-sink.html add indent guide images to themes 2012-08-02 15:28:44 +04:00
LICENSE Change LICENSE to BSD 2012-09-06 22:39:19 +02:00
Makefile Tweak styles to match new Panino 2012-08-31 16:13:38 -07:00
Makefile.dryice.js Add BSD license headers 2012-09-06 22:48:34 +02:00
package.json Change license in index.html and package.json 2012-09-08 11:44:22 +02:00
Readme.md Change Readme.md to BSD 2012-09-06 22:39:26 +02:00
static.js chnage static.js to run on node 0.8 as well 2012-07-10 10:06:56 +04:00
static.py Update Readme. Make static.py serve on port 8888 like static.js does. 2011-05-23 11:07:56 +02:00
version.js simple packager 2011-01-31 08:49:46 +01:00

Ace (Ajax.org Cloud9 Editor)

Ace is a standalone code editor written in JavaScript. Our goal is to create a browser based editor that matches and extends the features, usability and performance of existing native editors such as TextMate, Vim or Eclipse. It can be easily embedded in any web page or JavaScript application. Ace is developed as the primary editor for Cloud9 IDE and the successor of the Mozilla Skywriter (Bespin) Project.

Features

  • Syntax highlighting
  • Automatic indent and outdent
  • An optional command line
  • Handles huge documents (100,000 lines and more are no problem)
  • Fully customizable key bindings including VIM and Emacs modes
  • Themes (TextMate themes can be imported)
  • Search and replace with regular expressions
  • Highlight matching parentheses
  • Toggle between soft tabs and real tabs
  • Displays hidden characters
  • Drag and drop text using the mouse
  • Line wrapping
  • Code folding
  • Multiple selections
  • Live syntax checker (currently JavaScript/CoffeeScript/Css/XQuery)

Take Ace for a spin!

Check out the Ace live demo or get a Cloud9 IDE account to experience Ace while editing one of your own GitHub projects.

If you want, you can use Ace as a textarea replacement thanks to the Ace Bookmarklet.

Getting the code

Ace is a community project. We actively encourage and support contributions. The Ace source code is hosted on GitHub. It is released under the BSD License. This license is very simple, and is friendly to all kinds of projects, whether open source or not. Take charge of your editor and add your favorite language highlighting and keybindings!

    git clone git://github.com/ajaxorg/ace.git

Embedding Ace

Ace can be easily embedded into any existing web page. You can either use one of pre-packaged versions of ace (just copy one of src* subdirectories somewhere into your project), or use requireJS to load contents of lib/ace as ace

The easiest version is simply:

    <div id="editor">some text</div>
    <script src="src/ace.js" type="text/javascript" charset="utf-8"></script>
    <script>
        var editor = ace.edit("editor");
    </script>

With "editor" being the id of the DOM element, which should be converted to an editor. Note that this element must be explicitly sized and positioned absolute or relative for Ace to work. e.g.

    #editor {
        position: absolute;
        width: 500px;
        height: 400px;
    }

To change the theme simply include the Theme's JavaScript file

    <script src="src/theme-twilight.js" type="text/javascript" charset="utf-8"></script>

and configure the editor to use the theme:

    editor.setTheme("ace/theme/twilight");

By default the editor only supports plain text mode; many other languages are available as separate modules. After including the mode's JavaScript file:

    <script src="src/mode-javascript.js" type="text/javascript" charset="utf-8"></script>

Then the mode can be used like this:

    var JavaScriptMode = require("ace/mode/javascript").Mode;
    editor.getSession().setMode(new JavaScriptMode());

and take a look at the one of included demos of how to use Ace.

Documentation

You can find api documentation at http://ajaxorg.github.com/ace/api/index.html.

And a lot more sample code in the demo app.

There is also some documentation on the wiki page.

If you still need help, feel free to drop a mail on the ace mailing list.

Running Ace

After the checkout Ace works out of the box. No build step is required. To open editor with a file:/// URL see wiki. Or Simply start bundled mini HTTP server:

    ./static.py

Or using Node.JS

    npm install mime
    node ./static.js

The editor can then be opened at http://localhost:8888/kitchen-sink.html.

Package Ace

To package Ace we use the dryice build tool developed by the Mozilla Skywriter team. (see the wiki for more details)

    npm install
    node ./Makefile.dryice.js

Running the Unit Tests

The Ace unit tests can run on node.js. Assuming you have already done npm install, just call:

    node lib/ace/test/all.js

You can also run the tests in your browser by serving:

http://localhost:8888/lib/ace/test/tests.html

This makes debugging failing tests way more easier.

Continuous Integration status

This project is tested with Travis CI Build Status

Contributing

Ace wouldn't be what it is without contributions! Feel free to fork and improve/enhance Ace any way you want. If you feel that the editor or the Ace community will benefit from your changes, please open a pull request. To protect the interests of the Ace contributors and users we require contributors to sign a Contributors License Agreement (CLA) before we pull the changes into the main repository. Our CLA is the simplest of agreements, requiring that the contributions you make to an ajax.org project are only those you're allowed to make. This helps us significantly reduce future legal risk for everyone involved. It is easy, helps everyone, takes ten minutes, and only needs to be completed once. There are two versions of the agreement:

  1. The Individual CLA: use this version if you're working on an ajax.org in your spare time, or can clearly claim ownership of copyright in what you'll be submitting.
  2. The Corporate CLA: have your corporate lawyer review and submit this if your company is going to be contributing to ajax.org projects

If you want to contribute to an ajax.org project please print the CLA and fill it out and sign it. Then either send it by snail mail or fax to us or send it back scanned (or as a photo) by email.

Email: fabian.jakobs@web.de

Fax: +31 (0) 206388953

Address: Ajax.org B.V. Keizersgracht 241 1016 EA, Amsterdam the Netherlands