corrade-nucleus-nucleons – Blame information for rev 20

Subversion Repositories:
Rev:
Rev Author Line No. Line
20 office 1 Ace (Ajax.org Cloud9 Editor)
2 ============================
3  
4 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](http://www.cloud9ide.com/) and the successor of the Mozilla Skywriter (Bespin) Project.
5  
6 Features
7 --------
8  
9 * Syntax highlighting
10 * Automatic indent and outdent
11 * An optional command line
12 * Handles huge documents (100,000 lines and more are no problem)
13 * Fully customizable key bindings including VI and Emacs modes
14 * Themes (TextMate themes can be imported)
15 * Search and replace with regular expressions
16 * Highlight matching parentheses
17 * Toggle between soft tabs and real tabs
18 * Displays hidden characters
19 * Drag and drop text using the mouse
20 * Line wrapping
21 * Unstructured / user code folding
22 * Live syntax checker (currently JavaScript/CoffeeScript)
23  
24 Take Ace for a spin!
25 --------------------
26  
27 Check out the Ace live [demo](http://ajaxorg.github.com/ace/) or get a [Cloud9 IDE account](http://run.cloud9ide.com) to experience Ace while editing one of your own GitHub projects.
28  
29 If you want, you can use Ace as a textarea replacement thanks to the [Ace Bookmarklet](http://ajaxorg.github.com/ace/build/textarea/editor.html).
30  
31 History
32 -------
33  
34 Previously known as “Bespin” and “Skywriter” it’s now known as Ace (Ajax.org Cloud9 Editor)! Bespin and Ace started as two independent projects, both aiming to build a no-compromise code editor component for the web. Bespin started as part of Mozilla Labs and was based on the canvas tag, while Ace is the Editor component of the Cloud9 IDE and is using the DOM for rendering. After the release of Ace at JSConf.eu 2010 in Berlin the Skywriter team decided to merge Ace with a simplified version of Skywriter's plugin system and some of Skywriter's extensibility points. All these changes have been merged back to Ace. Both Ajax.org and Mozilla are actively developing and maintaining Ace.
35  
36 Getting the code
37 ----------------
38  
39 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!
40  
41 ```bash
42 git clone git://github.com/ajaxorg/ace.git
43 cd ace
44 git submodule update --init --recursive
45 ```
46  
47 Embedding Ace
48 -------------
49  
50 Ace can be easily embedded into any existing web page. The Ace git repository ships with a pre-packaged version of Ace inside of the `build` directory. The same packaged files are also available as a separate [download](https://github.com/ajaxorg/ace/downloads). Simply copy the contents of the `src` subdirectory somewhere into your project and take a look at the included demos of how to use Ace.
51  
52 The easiest version is simply:
53  
54 ```html
55 <div id="editor">some text</div>
56 <script src="src/ace.js" type="text/javascript" charset="utf-8"></script>
57 <script>
58 window.onload = function() {
59 var editor = ace.edit("editor");
60 };
61 </script>
62 ```
63  
64 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.
65  
66 ```css
67 #editor {
68 position: absolute;
69 width: 500px;
70 height: 400px;
71 }
72 ```
73  
74 To change the theme simply include the Theme's JavaScript file
75  
76 ```html
77 <script src="src/theme-twilight.js" type="text/javascript" charset="utf-8"></script>
78 ```
79  
80 and configure the editor to use the theme:
81  
82 ```javascript
83 editor.setTheme("ace/theme/twilight");
84 ```
85  
86 By default the editor only supports plain text mode; many other languages are available as separate modules. After including the mode's JavaScript file:
87  
88 ```html
89 <script src="src/mode-javascript.js" type="text/javascript" charset="utf-8"></script>
90 ```
91  
92 Then the mode can be used like this:
93  
94 ```javascript
95 var JavaScriptMode = require("ace/mode/javascript").Mode;
96 editor.getSession().setMode(new JavaScriptMode());
97 ```
98  
99 Documentation
100 -------------
101  
102 You find a lot more sample code in the [demo app](https://github.com/ajaxorg/ace/blob/master/demo/demo.js).
103  
104 There is also some documentation on the [wiki page](https://github.com/ajaxorg/ace/wiki).
105  
106 If you still need help, feel free to drop a mail on the [ace mailing list](http://groups.google.com/group/ace-discuss).
107  
108 Running Ace
109 -----------
110  
111 After the checkout Ace works out of the box. No build step is required. Open 'editor.html' in any browser except Google Chrome. Google Chrome doesn't allow XMLHTTPRequests from files loaded from disc (i.e. with a file:/// URL). To open Ace in Chrome simply start the bundled mini HTTP server:
112  
113 ```bash
114 ./static.py
115 ```
116  
117 Or using Node.JS
118  
119 ```bash
120 ./static.js
121 ```
122  
123 The editor can then be opened at http://localhost:8888/index.html.
124  
125 Package Ace
126 -----------
127  
128 To package Ace we use the dryice build tool developed by the Mozilla Skywriter team. Before you can build you need to make sure that the submodules are up to date.
129  
130 ```bash
131 git submodule update --init --recursive
132 ```
133  
134 Afterwards Ace can be built by calling
135  
136 ```bash
137 ./Makefile.dryice.js normal
138 ```
139  
140 The packaged Ace will be put in the 'build' folder.
141  
142 To build the bookmarklet version execute
143  
144 ```bash
145 ./Makefile.dryice.js bm
146 ```
147  
148 Running the Unit Tests
149 ----------------------
150  
151 The Ace unit tests run on node.js. Before the first run a couple of node modules have to be installed. The easiest way to do this is by using the node package manager (npm). In the Ace base directory simply call
152  
153 ```bash
154 npm link .
155 ```
156  
157 To run the tests call:
158  
159 ```bash
160 node lib/ace/test/all.js
161 ```
162  
163 You can also run the tests in your browser by serving:
164  
165 http://localhost:8888/lib/ace/test/tests.html
166  
167 This makes debugging failing tests way more easier.
168  
169 Contributing
170 ------------
171  
172 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:
173  
174 1. [The Individual CLA](https://github.com/ajaxorg/ace/raw/master/doc/Contributor_License_Agreement-v2.pdf): 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.
175 2. [The Corporate CLA](https://github.com/ajaxorg/ace/raw/master/doc/Corporate_Contributor_License_Agreement-v2.pdf): have your corporate lawyer review and submit this if your company is going to be contributing to ajax.org projects
176  
177 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.
178  
179 Email: fabian.jakobs@web.de
180  
181 Fax: +31 (0) 206388953
182  
183 Address: Ajax.org B.V.
184 Keizersgracht 241
185 1016 EA, Amsterdam
186 the Netherlands