core/api/soft/ace/ace-master/index.html

1174 lines
83 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Ace - The High Performance Code Editor for the Web</title>
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap.no-icons.min.css" />
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/3.0/css/font-awesome.css" />
<link href="./doc/site/style.css" rel="stylesheet" type="text/css" />
<link href="./doc/site/images/favicon.ico" rel="icon" type="image/x-icon" />
<script src="./build/src/ace.js"></script>
<script src="./build/src/ext-static_highlight.js"></script>
<!--[if lt IE 9]>
<script src="./build/src/ext-old_ie.js"></script>
<![endif]-->
</head>
<body>
<a href="https://github.com/ajaxorg/ace">
<img style="z-index: 50000; position: absolute; top: 0; right: 0; border: 0; width: 125px; height: 125px" src="https://github.blog/wp-content/uploads/2008/12/forkme_right_red_aa0000.png?resize=149%2C149" alt="Fork me on GitHub">
</a>
<div id="wrapper">
<div class="content">
<div class="column2">
<div id="top_container">
<h1><img src="./doc/site/images/textimage.png" alt="The high performance code editor for the web." /></h1>
<div id="page_logo">
<img src="./doc/site/images/ace-logo.png" />
<iframe style="padding-top:5px" src="https://ghbtns.com/github-btn.html?user=ajaxorg&amp;repo=ace&amp;type=watch&amp;count=true" allowtransparency="true" frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
<iframe src="https://ghbtns.com/github-btn.html?user=ajaxorg&amp;repo=ace&amp;type=fork&amp;count=true" allowtransparency="true" frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
</div>
</div>
<div style="clear: both"></div>
<ul id="tabnav" class="nav nav-pills">
<li>
<a href="/"><img src="./doc/site/images/ace-tab.png" /></a>
</li>
<li>
<a href="#about" data-toggle="tab">About</a>
</li>
<li>
<a href="#embedding" data-toggle="tab">Embedding Guide</a>
</li>
<li>
<a href="#howto" data-toggle="tab">How-To Guide</a>
</li>
<li>
<a href="#higlighter" data-toggle="tab">Syntax Highlighters</a>
</li>
<li>
<a href="https://ajaxorg.github.io/ace-api-docs/index.html" target="_blank" rel="noopener noreferrer" class="external-nav">API Reference</a>
</li>
<li>
<a href="#production" data-toggle="tab">Real World Users</a>
</li>
<li class="last-tab">
<a href="https://mkslanc.github.io/ace-playground/" target="_blank" rel="noopener noreferrer" class="external-nav">Try</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade" id="about">
<h1>Built for Code</h1>
<p id="first">Ace is an embeddable code editor written in JavaScript.
It matches the features and performance of native
editors such as Sublime, Vim and TextMate. It can be easily embedded
in any web page and JavaScript application. Ace is maintained as the
primary editor for <a href="https://c9.io">Cloud9 IDE</a>
and is the successor of the Mozilla Skywriter (Bespin) project.
</p>
<pre id="ace_editor_demo" style="opacity:0">/**
* In fact, you're looking at ACE right now. Go ahead and play with it!
*
* We are currently showing off the JavaScript mode. ACE has support for 45
* language modes and 24 color themes!
*/
function add(x, y) {
var resultString = "Hello, ACE! The result of your math is: ";
var result = x + y;
return resultString + result;
}
var addResult = add(3, 2);
console.log(addResult);
</pre>
<p id="embed_link"><a href="#nav=embedding">Learn how to embed this in your own site</a></p>
<p class="highlight_note">Looking for a more full-featured demo? Check out the
<a href="build/kitchen-sink.html" target="_blank" rel="noopener noreferrer">kitchen sink</a>.
</p>
<h2>Features</h2>
<ul class="content-list">
<li><a href="https://pcwalton.blogspot.com/2010/11/syntax-highlighting-specification.html">Syntax highlighting</a> for over 110 languages (TextMate/Sublime Text<em>.tmlanguage</em> files can be imported)</li>
<li>Over 20 themes (TextMate/Sublime Text <em>.tmtheme</em> files can be imported)</li>
<li>Automatic indent and outdent</li>
<li>An optional command line</li>
<li>Handles huge documents (four million lines seems to be the limit!)</li>
<li>Fully customizable key bindings including vim and Emacs modes</li>
<li>Search and replace with regular expressions</li>
<li>Highlight matching parentheses</li>
<li>Toggle between soft tabs and real tabs</li>
<li>Displays hidden characters</li>
<li>Drag and drop text using the mouse</li>
<li>Line wrapping</li>
<li>Code folding</li>
<li>Multiple cursors and selections</li>
<li>Live syntax checker (currently JavaScript/CoffeeScript/CSS/XQuery)</li>
<li>Cut, copy, and paste functionality</li>
</ul>
<h2>Get the Open-Source Code</h2>
<p>Ace is a community project. We actively encourage and support
contributions! The Ace source code is <a href="https://github.com/ajaxorg/ace">hosted on GitHub</a>
and released under the BSD license &dash;
very simple and friendly to all kinds of projects, whether open-source
or not. Take charge of your editor and add your favorite language
highlighting and keybindings!
</p>
<pre>git clone git://github.com/ajaxorg/ace.git</pre>
<h2>History</h2>
<p>Skywriter/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 &lt;canvas> tag, while Ace is
the editor component of <a href="https://c9.io">Cloud9 IDE</a>
and uses the DOM for rendering. After the release of Ace at
<a href="https://www.youtube.com/watch?v=hN_7tAKh0dM" title="[JSConfEU 2010] Fabian Jakobs: Kick ass code editing and end to end JavaScript debugging">JSConf.eu 2010</a>
in Berlin the Skywriter team decided to merge Ace with a simplified
version of Skywriter's plugin system and some of Skywriter&apos;s
extensibility points. All these changes have been merged back to Ace
now, which supersedes Skywriter. Both <a href="https://c9.io">Cloud9 IDE</a>
and <a href="https://mozilla.org">Mozilla</a> are actively developing and
maintaining Ace.
</p>
<h2>Related Projects</h2>
<ul class="content-list">
<li><a href="https://github.com/convergencelabs/ace-collab-ext">Ace collaboration extension</a></li>
<li><a href="https://github.com/rksm/paredit.js">Paredit extension for ace</a></li>
<li><a href="https://github.com/cadorn/ace-extjs">Ace wrapper for ExtJS</a></li>
<li><a href="https://github.com/daveho/AceGWT">Ace wrapper for GWT</a></li>
</ul>
<h2>Getting Help</h2>
<ul class="content-list">
<li><a href="https://github.com/ajaxorg/ace/issues">Report bugs</a></li>
<li><a href="https://github.com/ajaxorg/ace/discussions">Discuss</a></li>
</ul>
</div>
<div class="tab-pane fade active in" id="embedding">
<h1>Embedding Ace in Your Site</h1>
<p>Ace can be easily embedded into a web page. Get prebuilt version of ace from
<a href="https://github.com/ajaxorg/ace-builds/">ace-builds</a> repository and use the code below:</p>
<pre id="embedded_ace_code" style="opacity:0">&lt;!DOCTYPE html>
&lt;html lang="en">
&lt;head>
&lt;title>ACE in Action&lt;/title>
&lt;style type="text/css" media="screen">
#editor {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
&lt;/style>
&lt;/head>
&lt;body>
&lt;div id="editor">function foo(items) {
var x = "All this is syntax highlighted";
return x;
}&lt;/div>
&lt;script src="/ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8">&lt;/script>
&lt;script>
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.session.setMode("ace/mode/javascript");
&lt;/script>
&lt;/body>
&lt;/html></pre>
<p>Now check out the <a href="#nav=howto">How-To Guide</a> for instructions on
common operations, such as setting a different language mode or
getting the contents from the editor.
</p>
<h2>Loading Ace from a Local URL</h2>
<p>If you want to clone and host Ace locally you can
use one of the <a href="https://github.com/ajaxorg/ace-builds/">pre-packaged versions</a>. Just copy
one of <code>src*</code> subdirectories somewhere into your project, or use RequireJS to load the
contents of <a href="https://github.com/ajaxorg/ace/tree/master/lib/ace">lib/ace</a> folder as <code>ace</code>:
</p>
<h2>Loading Ace from a CDN</h2>
<p>The packaged version can also be loaded from CDN's such as <a href="https://www.jsdelivr.com/package/npm/ace-builds">jsDelivr</a> or <a href="http://cdnjs.com/libraries/ace/">cdnjs</a>.
</p>
</div>
<div class="tab-pane fade" id="howto">
<h1>Working with Ace</h1>
<p><em>In all of these examples Ace has been invoked
as shown in the <a href="#nav=embedding">embedding guide</a>.</em>
</p>
<h2>Configuring the editor</h2>
<p>there are several ways to pass configuration to Ace</p>
<pre><code class="javascript">// pass options to ace.edit
ace.edit(element, {
mode: "ace/mode/javascript",
selectionStyle: "text"
})
// use setOptions method to set several options at once
editor.setOptions({
autoScrollEditorIntoView: true,
copyWithEmptySelection: true,
});
// use setOptions method
editor.setOption("mergeUndoDeltas", "always");
// some options are also available as methods e.g.
editor.setTheme(...)
// to get the value of the option use
editor.getOption("optionName");
</code>
</pre>
<p>See <a href="https://github.com/ajaxorg/ace/wiki/Configuring-Ace">Configuring-Ace wiki page</a> for a more detailed list of options.</p>
<h3>Changing the size of the editor</h3>
<p>Ace only checks for changes of the size of it's container when window is resized. If you resize the editor div in another manner, and need Ace to resize, use the following:</p>
<pre><code class="javascript">editor.resize()</code></pre>
<p>if you want editor to change it's size based on contents, use maxLines option as shown in <a target="_blank" rel="noopener noreferrer" href="https://ace.c9.io/demo/autoresize.html">https://ace.c9.io/demo/autoresize.html</a></p>
<h2>Setting Themes</h2>
<p>Themes are loaded on demand; all you have to do is pass the string name:</p>
<pre><code class="javascript">editor.setTheme("ace/theme/twilight");</code></pre>
<p><span class="expand_arrow">&gt;</span> <a href="https://github.com/ajaxorg/ace/tree/master/src/theme" target="_blank" rel="noopener noreferrer">See all themes.</a>
Or use <a href="https://github.com/ajaxorg/ace/blob/master/src/ext/themelist.js" target="_blank" rel="noopener noreferrer">themelist extension</a> to get the list of available themes at runtime.
</p>
<h2>Setting the Programming Language Mode</h2>
<p>By default, the editor supports plain text mode. All other language modes are available as separate modules, loaded on demand like this:</p>
<pre><code class="javascript">editor.session.setMode("ace/mode/javascript");</code></pre>
<h2>One Editor, Multiple Sessions</h2>
<p>Ace keeps everything about the state of the editor (selection, scroll position, etc.)
in <code class="javascript">editor.session</code>. This means you can grab the
session, store it in a var, and set the editor to another session (e.g. a tabbed editor).</p>
<p>You might accomplish this like so:</p>
<pre><code class="javascript">var js = ace.createEditSession("some js code");
var css = ace.createEditSession(["some", "css", "code here"]);
// and then to load document into editor, just call
editor.setSession(js);</code></pre>
<h2>Common Operations</h2>
<p>Set and get content:</p>
<pre><code class="javascript">editor.setValue("the new text here");
editor.setValue("text2", -1); // set value and move cursor to the start of the text
editor.session.setValue("the new text here"); // set value and reset undo history
editor.getValue(); // or session.getValue</code></pre>
<p>Get selected text:</p>
<pre><code class="javascript">editor.getSelectedText(); // or for a specific range
editor.session.getTextRange(editor.getSelectionRange()); </code></pre>
<p>Insert at cursor, emulating user input:</p>
<pre><code class="javascript">editor.insert("Something cool");</code></pre>
<p>Replace text in range:</p>
<pre><code class="javascript">editor.session.replace(new ace.Range(0, 0, 1, 1), "new text");</code></pre>
<p>Get the current cursor line and column:</p>
<pre><code class="javascript">editor.selection.getCursor();</code></pre>
<p>Go to a line:</p>
<pre><code class="javascript">editor.gotoLine(lineNumber);</code></pre>
<p>Get total number of lines:</p>
<pre><code class="javascript">editor.session.getLength();</code></pre>
<p>Set the default tab size:</p>
<pre><code class="javascript">editor.session.setTabSize(4);</code></pre>
<p>Use soft tabs:</p>
<pre><code class="javascript">editor.session.setUseSoftTabs(true);</code></pre>
<p>Set the font size:</p>
<pre><code class="javascript">document.getElementById('editor').style.fontSize='12px';</code></pre>
<p>Toggle word wrapping:</p>
<pre><code class="javascript">editor.session.setUseWrapMode(true);</code></pre>
<p>Set line highlighting:</p>
<pre><code class="javascript">editor.setHighlightActiveLine(false);</code></pre>
<p>Set the print margin visibility:</p>
<pre><code class="javascript">editor.setShowPrintMargin(false);</code></pre>
<p>Set the editor to read-only:</p>
<pre><code class="javascript">editor.setReadOnly(true); // false to make it editable</code></pre>
<h3>Using undo manager</h3>
<p>To group undo delta of the next edit with the previous one set `mergeUndoDeltas` to true</p>
<pre><code class="language-javascript">editor.session.mergeUndoDeltas = true;
editor.session.insert({row: 0, column:0}, Date()+"");</code></pre>
<p>To start new undo group use `markUndoGroup` method</p>
<pre><code class="language-javascript">editor.insertSnippet("a$0b");
editor.session.markUndoGroup();
editor.insertSnippet("x$0y");</code></pre>
<p>To disable undo of a an edit in a collaborative editor</p>
<pre><code class="language-javascript">var rev = session.$undoManager.startNewGroup(); // start new undo group
... // apply the edit
session.$undoManager.markIgnored(rev); // mark the new group as ignored</code></pre>
<p>To implement undo/redo buttons see <a target="_blank" rel="noopener noreferrer" href="https://ace.c9.io/demo/toolbar.html">https://ace.c9.io/demo/toolbar.html</a></p>
<h3>Searching</h3>
<pre><code class="language-javascript">editor.find('needle',{
backwards: false,
wrap: false,
caseSensitive: false,
wholeWord: false,
regExp: false
});
editor.findNext();
editor.findPrevious();</code></pre>
<p>The following options are available to you for your search parameters:</p>
<ul>
<li>
<code>needle</code>: The string or regular expression you're looking for
</li>
<li>
<code>backwards</code>: Whether to search backwards from where cursor currently is. Defaults to <code>false</code>.
</li>
<li>
<code>wrap</code>: Whether to wrap the search back to the beginning when it hits the end. Defaults to <code>false</code>.
</li>
<li>
<code>caseSensitive</code>: Whether the search ought to be case-sensitive. Defaults to <code>false</code>.
</li>
<li>
<code>wholeWord</code>: Whether the search matches only on whole words. Defaults to <code>false</code>.
</li>
<li>
<code>range</code>: The <a class="internal absent" href="/ajaxorg/ace/wiki/Range">Range</a> to search within. Set this to <code>null</code> for the whole document
</li>
<li>
<code>regExp</code>: Whether the search is a regular expression or not. Defaults to <code>false</code>.
</li>
<li>
<code>start</code>: The starting <a class="internal absent" href="/ajaxorg/ace/wiki/Range">Range</a> or cursor position to begin the search
</li>
<li>
<code>skipCurrent</code>: Whether or not to include the current line in the search. Default to <code>false</code>.
</li>
<li>
<code>preventScroll</code>: Whether or not to move the cursor to the next match. Default to <code>false</code>.
</li>
</ul>
<p>Here's how you can perform a replace:</p>
<pre><code class="javascript">editor.find('foo');
editor.replace('bar');</code></pre>
<p>And here's a replace all: </p>
<pre><code class="javascript">editor.replaceAll('bar');</code></pre>
<p>(<code>editor.replaceAll</code> uses the needle set earlier by <code>editor.find('needle', ...</code>)</p>
<h3>Listening to Events</h3>
<p>To listen for an <code>onchange</code>:</p>
<pre><code class="javascript">editor.session.on('change', function(delta) {
// delta.start, delta.end, delta.lines, delta.action
});</code></pre>
<p>To listen for an <code>selection</code> change:</p>
<pre><code class="javascript">editor.session.selection.on('changeSelection', function(e) {
});</code></pre>
<p>To listen for a <code>cursor</code> change:</p>
<pre><code class="javascript">editor.session.selection.on('changeCursor', function(e) {
});</code></pre>
<h3>Adding New Commands and Keybindings</h3>
<p>To assign key bindings to a custom function:</p>
<pre><code class="javascript">editor.commands.addCommand({
name: 'myCommand',
bindKey: {win: 'Ctrl-M', mac: 'Command-M'},
exec: function(editor) {
//...
},
readOnly: true, // false if this command should not apply in readOnly mode
// multiSelectAction: "forEach", optional way to control behavior with multiple cursors
// scrollIntoView: "cursor", control how cursor is scolled into view after the command
});</code></pre>
<h3>Configure dynamic loading of modes and themes</h3>
<p>By default ace detcts the url for dynamic loading by finding the script node for ace.js.
This doesn't work if ace.js is not loaded with a separate script tag, and in this case it is required to set url explicitely</p>
<pre><code class="javascript">ace.config.set("basePath", "https://url.to.a/folder/that/contains-ace-modes");</code></pre>
<p>Path for one module alone can be configured with:</p>
<pre><code class="javascript">ace.config.setModuleUrl("ace/theme/textmate", "url for textmate.js");</code></pre>
<p>When using ace with webpack, it is possible to configure paths for all submodules using</p>
<pre><code class="javascript">require("ace-builds/esm-resolver"); // for new bundlers: webpack 5, rollup, vite</code></pre>
For webpack 4 use
<pre><code class="javascript">require("ace-builds/webpack-resolver"); </code></pre>
<p>which depends on <a href="https://github.com/webpack-contrib/file-loader">file-loader</a></p>
</div>
<div class="tab-pane fade" id="higlighter">
<h1>Creating a Syntax Highlighter for Ace</h1>
<p>Creating a new syntax highlighter for Ace is extremely simple. You'll need to define two pieces of code: a new mode, and a new set of highlighting rules.</p>
<h2 id="where-to-start"><a class="heading_anchor" href="#where-to-start"><i class="headerLinkIcon"></i></a>Where to Start</h2>
<p>We recommend using the <a href="tool/mode_creator.html">Ace Mode Creator</a> when defining your highlighter. This allows you to inspect your code's tokens, as well as providing a live preview of the syntax highlighter in action.</p>
<h2 id="defining-a-mode"><a class="heading_anchor" href="#defining-a-mode"><i class="headerLinkIcon"></i></a>Defining a Mode</h2>
<p>Every language needs a mode. A mode contains the paths to a language's syntax highlighting rules, indentation rules, and code folding rules. Without defining a mode, Ace won't know anything about the finer aspects of your language.</p>
<p>Here is the starter template we'll use to create a new mode:</p>
<pre><code class="language-javascript">define(function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
// defines the parent mode
var TextMode = require("./text").Mode;
var Tokenizer = require("../tokenizer").Tokenizer;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
// defines the language specific highlighters and folding rules
var MyNewHighlightRules = require("./mynew_highlight_rules").MyNewHighlightRules;
var MyNewFoldMode = require("./folding/mynew").MyNewFoldMode;
var Mode = function() {
// set everything up
this.HighlightRules = MyNewHighlightRules;
this.$outdent = new MatchingBraceOutdent();
this.foldingRules = new MyNewFoldMode();
};
oop.inherits(Mode, TextMode);
(function() {
// configure comment start/end characters
this.lineCommentStart = "//";
this.blockComment = {start: "/*", end: "*/"};
// special logic for indent/outdent.
// By default ace keeps indentation of previous line
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line);
return indent;
};
this.checkOutdent = function(state, line, input) {
return this.$outdent.checkOutdent(line, input);
};
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row);
};
// create worker for live syntax checking
this.createWorker = function(session) {
var worker = new WorkerClient(["ace"], "ace/mode/mynew_worker", "NewWorker");
worker.attachToDocument(session.getDocument());
worker.on("errors", function(e) {
session.setAnnotations(e.data);
});
return worker;
};
}).call(Mode.prototype);
exports.Mode = Mode;
});</code></pre>
<p>What's going on here? First, you're defining the path to <code>TextMode</code> (more on this later). Then you're pointing the mode to your definitions for the highlighting rules, as well as your rules for code folding. Finally, you're setting everything up to find those rules, and exporting the Mode so that it can be consumed. That's it!</p>
<p>Regarding <code>TextMode</code>, you'll notice that it's only being used once: <code>oop.inherits(Mode, TextMode);</code>. If your new language depends on the rules of another language, you can choose to inherit the same rules, while expanding on it with your language's own requirements. For example, PHP inherits from HTML, since it can be embedded directly inside <em>.html</em> pages. You can either inherit from <code>TextMode</code>, or any other existing mode, if it already relates to your language.</p>
<p>All Ace modes can be found in the <em>lib/ace/mode</em> folder.</p>
<h2 id="defining-syntax-highlighting-rules"><a class="heading_anchor" href="#defining-syntax-highlighting-rules"><i class="headerLinkIcon"></i></a>Defining Syntax Highlighting Rules</h2>
<p>The Ace highlighter can be considered to be a state machine. Regular expressions define the tokens for the current state, as well as the transitions into another state. Let's define <em>mynew_highlight_rules.js</em>, which our mode above uses.</p>
<p>All syntax highlighters start off looking something like this:</p>
<pre><code class="language-javascript">define(function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var MyNewHighlightRules = function() {
// regexp must not have capturing parentheses. Use (?:) instead.
// regexps are ordered -&gt; the first match is used
this.$rules = {
"start" : [
{
token: token, // String, Array, or Function: the CSS token to apply
regex: regex, // String or RegExp: the regexp to match
next: next // [Optional] String: next state to enter
}
]
};
};
oop.inherits(MyNewHighlightRules, TextHighlightRules);
exports.MyNewHighlightRules = MyNewHighlightRules;
});</code></pre>
<p>The token state machine operates on whatever is defined in <code>this.$rules</code>. The highlighter always begins at the <code>start</code> state, and progresses down the list, looking for a matching <code>regex</code>. When one is found, the resulting text is wrapped within a <code>&lt;span class=&quot;ace_&lt;token&gt;&quot;&gt;</code> tag, where <code>&lt;token&gt;</code> is defined as the <code>token</code> property. Note that all tokens are preceded by the <code>ace_</code> prefix when they're rendered on the page.</p>
<p>Once again, we're inheriting from <code>TextHighlightRules</code> here. We could choose to make this any other language set we want, if our new language requires previously defined syntaxes. For more information on extending languages, see &quot;<a href="#extending-highlighters">extending Highlighters</a>&quot; below.</p>
<h3 id="defining-tokens"><a class="heading_anchor" href="#defining-tokens"><i class="headerLinkIcon"></i></a>Defining Tokens</h3>
<p>The Ace highlighting system is heavily inspired by the <a href="http://manual.macromates.com/en/language_grammars">TextMate language grammar</a>. Most tokens will follow the conventions of TextMate when naming grammars. A thorough (albeit incomplete) list of tokens can be found <a href="https://github.com/ajaxorg/ace/wiki/Creating-or-Extending-an-Edit-Mode#wiki-commonTokens">on the Ace Wiki</a>.</p>
<p>For the complete list of tokens, see <em><a href="https://github.com/ajaxorg/ace/blob/master/tool/tmtheme.js">tool/tmtheme.js</a></em>. It is possible to add new token names, but the scope of that knowledge is outside of this document.</p>
<p>Multiple tokens can be applied to the same text by adding dots in the token, <em>e.g.</em> <code>token: support.function</code> wraps the text in a <code>&lt;span class=&quot;ace_support ace_function&quot;&gt;</code> tag.</p>
<h3 id="defining-regular-expressions"><a class="heading_anchor" href="#defining-regular-expressions"><i class="headerLinkIcon"></i></a>Defining Regular Expressions</h3>
<p>Regular expressions can either be a RegExp or String definition</p>
<p>If you're using a regular expression, remember to start and end the line with the <code>/</code> character, like this:</p>
<pre><code class="language-javascript">{
token : "constant.language.escape",
regex : /\$[\w\d]+/
}</code></pre>
<p>A caveat of using stringed regular expressions is that any <code>\</code> character must be escaped. That means that even an innocuous regular expression like this:</p>
<pre><code class="language-javascript">regex: "function\s*\(\w+\)"</code></pre>
<p>Must actually be written like this:</p>
<pre><code class="language-javascript">regex: "function\\s*\(\\w+\)"</code></pre>
<h4 id="groupings"><a class="heading_anchor" href="#groupings"><i class="headerLinkIcon"></i></a>Groupings</h4>
<p>You can also include flat regexps--<code>(var)</code>--or have matching groups--<code>((a+)(b+))</code>. There is a strict requirement whereby matching groups <strong>must</strong> cover the entire matched string; thus, <code>(hel)lo</code> is invalid. If you want to create a non-matching group, simply start the group with the <code>?:</code> predicate; thus, <code>(hel)(?:lo)</code> is okay. You can, of course, create longer non-matching groups. For example:</p>
<pre><code class="language-javascript">{
token : "constant.language.boolean",
regex : /(?:true|false)\b/
},</code></pre>
<p>For flat regular expression matches, <code>token</code> can be a String, or a Function that takes a single argument (the match) and returns a string token. For example, using a function might look like this:</p>
<pre><code class="language-javascript">var colors = lang.arrayToMap(
("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
"purple|red|silver|teal|white|yellow").split("|")
);
var fonts = lang.arrayToMap(
("arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|" +
"symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|" +
"serif|monospace").split("|")
);
...
{
token: function(value) {
if (colors.hasOwnProperty(value.toLowerCase())) {
return "support.constant.color";
}
else if (fonts.hasOwnProperty(value.toLowerCase())) {
return "support.constant.fonts";
}
else {
return "text";
}
},
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
}</code></pre>
<p>If <code>token</code> is a function,it should take the same number of arguments as there are groups, and return an array of tokens.</p>
<p>For grouped regular expressions, <code>token</code> can be a String, in which case all matched groups are given that same token, like this:</p>
<pre><code class="language-javascript">{
token: "identifier",
regex: "(\\w+\\s*:)(\\w*)"
}</code></pre>
<p>More commonly, though, <code>token</code> is an Array (of the same length as the number of groups), whereby matches are given the token of the same alignment as in the match. For a complicated regular expression, like defining a function, that might look something like this:</p>
<pre><code class="language-javascript">{
token : ["storage.type", "text", "entity.name.function"],
regex : "(function)(\\s+)([a-zA-Z_][a-zA-Z0-9_]*\\b)"
}</code></pre>
<h2 id="defining-states"><a class="heading_anchor" href="#defining-states"><i class="headerLinkIcon"></i></a>Defining States</h2>
<p>The syntax highlighting state machine stays in the <code>start</code> state, until you define a <code>next</code> state for it to advance to. At that point, the tokenizer stays in that new <code>state</code>, until it advances to another state. Afterwards, you should return to the original <code>start</code> state.</p>
<p>Here's an example:</p>
<pre><code class="language-javascript">this.$rules = {
"start" : [ {
token : "text",
regex : "&lt;\\!\\[CDATA\\[",
next : "cdata"
} ],
"cdata" : [ {
token : "text",
regex : "\\]\\]&gt;",
next : "start"
}, {
defaultToken : "text"
} ]
};</code></pre>
<p>In this extremely short sample, we're defining some highlighting rules for when Ace detects a <code>&lt;![CDATA</code> tag. When one is encountered, the tokenizer moves from <code>start</code> into the <code>cdata</code> state. It remains there, applying the <code>text</code> token to any string it encounters. Finally, when it hits a closing <code>]&gt;</code> symbol, it returns to the <code>start</code> state and continues to tokenize anything else.</p>
<h2>Using the TMLanguage Tool</h2>
<p>There is a tool that
will take an existing <em>tmlanguage</em> file and do its best to convert it into Javascript for Ace to consume. Here's what you need to get started:
</p>
<ol>
<li>In the Ace repository, navigate to the <em><a href="https://github.com/ajaxorg/ace/tree/master/tool">tools</a></em> folder.</li>
<li>Run <code>npm install</code> to install required dependencies.</li>
<li>Run <code>node tmlanguage.js &lt;path_to_tmlanguage_file&gt;</code>; for example, <code>node &lt;path_to_tmlanguage_file&gt; /Users/Elrond/elven.tmLanguage</code></li>
</ol>
<p>Two files are created and placed in <em>lib/ace/mode</em>: one for the language mode, and one for the set of highlight rules. You will still need to add the code into <em>ace/ext/modelist.js</em>, and add a sample file for testing.</p>
<h3 id="a-note-on-accuracy"><a class="heading_anchor" href="#a-note-on-accuracy"><i class="headerLinkIcon"></i></a>A Note on Accuracy</h3>
<p>Your <em>.tmlanguage</em> file will then be converted to the best of the converters ability. It is an understatement to say that the tool is imperfect. Probably, language mode creation will never be able to be fully autogenerated. There's a list of non-determinable items; for example:</p>
<ul>
<li>The use of regular expression lookbehinds<br />This is a concept that JavaScript simply does not have and needs to be faked</li>
<li>Deciding which state to transition to<br />While the tool does create new states correctly, it labels them with generic terms like <code>state_2</code>, <code>state_10</code>, <em>e.t.c.</em></li>
<li>Extending modes<br />Many modes say something like <code>include source.c</code>, to mean, “add all the rules in C highlighting.” That syntax does not make sense to Ace or this tool (though of course you can <a href="/extension-development-resources/guides/extending_highlighters.html">extending existing highlighters</a>).</li>
<li>Rule preference order</li>
<li>Gathering keywords<br />Most likely, youll need to take keywords from your language file and run them through <code>createKeywordMapper()</code></li>
</ul>
<p>However, the tool is an excellent way to get a quick start, if you already possess a <em>tmlanguage</em> file for you language.</p>
<h2>Extending Highlighters</h2>
<p>Suppose you&#39;re working on a LuaPage, PHP embedded in HTML, or a Django template. You&#39;ll need to create a syntax highlighter that takes all the rules from the original language (Lua, PHP, or Python) and extends it with some additional identifiers (<code>&lt;?lua</code>, <code>&lt;?php</code>, <code>{%</code>, for example). Ace allows you to easily extend a highlighter using a few helper functions.</p>
<h3 id="getting-existing-rules"><a class="heading_anchor" href="#getting-existing-rules"><i class="headerLinkIcon"></i></a>Getting Existing Rules</h3>
<p>To get the existing syntax highlighting rules for a particular language, use the <code>getRules()</code> function. For example:</p>
<pre><code class="language-javascript">var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
this.$rules = new HtmlHighlightRules().getRules();
/*
this.$rules == Same this.$rules as HTML highlighting
*/</code></pre>
<h3 id="extending-a-highlighter"><a class="heading_anchor" href="#extending-a-highlighter"><i class="headerLinkIcon"></i></a>Extending a Highlighter</h3>
<p>The <code>addRules</code> method does one thing, and it does one thing well: it adds new rules to an existing rule set, and prefixes any state with a given tag. For example, let&#39;s say you&#39;ve got two sets of rules, defined like this:</p>
<pre><code class="language-javascript">this.$rules = {
"start": [ /* ... */ ]
};
var newRules = {
"start": [ /* ... */ ]
}</code></pre>
<p>If you want to incorporate <code>newRules</code> into <code>this.$rules</code>, you&#39;d do something like this:</p>
<pre><code class="language-javascript">this.addRules(newRules, "new-");
/*
this.$rules = {
"start": [ ... ],
"new-start": [ ... ]
};
*/</code></pre>
<h3 id="extending-two-highlighters"><a class="heading_anchor" href="#extending-two-highlighters"><i class="headerLinkIcon"></i></a>Extending Two Highlighters</h3>
<p>The last function available to you combines both of these concepts, and it&#39;s called <code>embedRules</code>. It takes three parameters:</p>
<ol>
<li>An existing rule set to embed with</li>
<li>A prefix to apply for each state in the existing rule set</li>
<li>A set of new states to add</li>
</ol>
<p>Like <code>addRules</code>, <code>embedRules</code> adds on to the existing <code>this.$rules</code> object. </p>
<p>To explain this visually, let&#39;s take a look at the syntax highlighter for Lua pages, which combines all of these concepts:</p>
<pre><code class="language-javascript">var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules;
var LuaPageHighlightRules = function() {
this.$rules = new HtmlHighlightRules().getRules();
for (var i in this.$rules) {
this.$rules[i].unshift({
token: "keyword",
regex: "&lt;\\%\\=?",
next: "lua-start"
}, {
token: "keyword",
regex: "&lt;\\?lua\\=?",
next: "lua-start"
});
}
this.embedRules(LuaHighlightRules, "lua-", [
{
token: "keyword",
regex: "\\%&gt;",
next: "start"
},
{
token: "keyword",
regex: "\\?&gt;",
next: "start"
}
]);
};</code></pre>
<p>Here, <code>this.$rules</code> starts off as a set of HTML highlighting rules. To this set, we add two new checks for <code>&lt;%=</code> and <code>&lt;?lua=</code>. We also delegate that if one of these rules are matched, we should move onto the <code>lua-start</code> state. Next, <code>embedRules</code> takes the already existing set of <code>LuaHighlightRules</code> and applies the <code>lua-</code> prefix to each state there. Finally, it adds two new checks for <code>%&gt;</code> and <code>?&gt;</code>, allowing the state machine to return to <code>start</code>.</p>
<h3>Code Folding</h3>
<p>Adding new folding rules to your mode can be a little tricky. First, insert the following lines of code into your mode definition:</p>
<pre><code class="language-javascript">var MyFoldMode = require("./folding/newrules").FoldMode;
...
var MyMode = function() {
...
this.foldingRules = new MyFoldMode();
};</code></pre>
<p>You&#39;ll be defining your code folding rules into the <em>lib/ace/mode/folding</em> folder. Here&#39;s a template that you can use to get started:</p>
<pre><code class="language-javascript">define(function(require, exports, module) {
"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function() {};
oop.inherits(FoldMode, BaseFoldMode);
(function() {
// regular expressions that identify starting and stopping points
this.foldingStartMarker;
this.foldingStopMarker;
this.getFoldWidgetRange = function(session, foldStyle, row) {
var line = session.getLine(row);
// test each line, and return a range of segments to collapse
};
}).call(FoldMode.prototype);
});</code></pre>
<p>Just like with <code>TextMode</code> for syntax highlighting, <code>BaseFoldMode</code> contains the starting point for code folding logic. <code>foldingStartMarker</code> defines your opening folding point, while <code>foldingStopMarker</code> defines the stopping point. For example, for a C-style folding system, these values might look like this:</p>
<pre><code class="language-javascript">this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;</code></pre>
<p>These regular expressions identify various symbols--<code>{</code>, <code>[</code>, <code>//</code>--to pay attention to. <code>getFoldWidgetRange</code> matches on these regular expressions, and when found, returns the range of relevant folding points. For more information on the <code>Range</code> object, see <a href="#nav=api&amp;api=range">the Ace API documentation</a>.</p>
<p>Again, for a C-style folding mechanism, a range to return for the starting fold might look like this:</p>
<pre><code class="language-javascript">var line = session.getLine(row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length);
range.end.column -= 2;
return range;
}</code></pre>
<p>Let&#39;s say we stumble across the code block <code>hello_world() {</code>. Our range object here becomes:</p>
<pre><code class="language-json">{
startRow: 0,
endRow: 0,
startColumn: 0,
endColumn: 13
}</code></pre>
<h2>Testing Your Highlighter</h2>
<p>The best way to test your tokenizer is to see it live, right? To do that, you&#39;ll want to modify the <a href="build/kitchen-sink.html">live Ace demo</a> to preview your changes. You can find this file in the root Ace directory with the name <em>kitchen-sink.html</em>.</p>
<ol>
<li>
add an entry to <code>supportedModes</code> in <a href="https://github.com/ajaxorg/ace/blob/master/lib/ace/ext/modelist.js#L53"><code>ace/ext/modelist.js</code></a>
</li>
<li>
<p>add a sample file to <code>demo/kitchen-sink/docs/</code> with same name as the mode file
</li>
</ol>
<p>Once you set this up, you should be able to witness a live demonstration of your new highlighter.</p>
<h3 id="adding-automated-tests"><a class="heading_anchor" href="#adding-automated-tests"><i class="headerLinkIcon"></i></a>Adding Automated Tests</h3>
<p>Adding automated tests for a highlighter is trivial so you are not required to do it, but it can help during development.</p>
<p>In <code>lib/ace/mode/_test</code> create a file named <code><pre>text_<span style="color:#AA0D91">&lt;modeName&gt;</span>.txt</pre></code> with some example code. (You can skip this if the document you have added in <code>demo/docs</code> both looks good and covers various edge cases in your language syntax).
</p>
<p> Run <code><span style="color:#AA0D91">node</span> <span style="color:#008800">highlight_rules_test.js</span> <span style="color:#000088">-gen</span></code> to preserve current output of your tokenizer in <code>tokens_<span style="color:#AA0D91">&lt;modeName&gt;</span>.json</code>
</p>
<p>After this running <code><span style="color:#008800">highlight_rules_test.js</span> <span style="color:#000088">optionalLanguageName</span></code> will compare output of your tokenizer with the correct output you've created.
</p>
<p>Any files ending with the <em>_test.js</em> suffix are automatically run by Ace&#39;s <a href="https://travis-ci.org/#!/ajaxorg/ace">Travis CI</a> server.</p>
</div>
<div class="tab-pane fade" id="api">
<div class="row centerpiece">
<div id="sidebarContainer" class="span2">
<div id="sidebar">
<div id="well">
<ul class="menu">
<li>
<div class="menu-item"><a href="./api/ace.html" class="menuLink namespace">Ace</a></div>
</li>
<li>
<div class="menu-item"><a href="./api/anchor.html" class="menuLink namespace">Anchor</a></div>
</li>
<li>
<div class="menu-item"><a href="./api/background_tokenizer.html" class="menuLink namespace">BackgroundTokenizer </a></div>
</li>
<li>
<div class="menu-item"><a href="./api/document.html" class="menuLink namespace">Document </a></div>
</li>
<li>
<div class="menu-item"><a href="./api/edit_session.html" class="menuLink namespace">EditSession</a></div>
</li>
<li>
<div class="menu-item"><a href="./api/editor.html" class="menuLink namespace">Editor</a></div>
</li>
<li>
<div class="menu-item"><a href="./api/range.html" class="menuLink namespace">Range</a></div>
</li>
<li>
<div class="menu-item"><a href="./api/scrollbar.html" class="menuLink namespace">Scrollbar</a></div>
</li>
<li>
<div class="menu-item"><a href="./api/search.html" class="menuLink namespace">Search </a></div>
</li>
<li>
<div class="menu-item"><a href="./api/selection.html" class="menuLink namespace">Selection </a></div>
</li>
<li>
<div class="menu-item"><a href="./api/token_iterator.html" class="menuLink namespace">TokenIterator</a></div>
</li>
<li>
<div class="menu-item"><a href="./api/tokenizer.html" class="menuLink namespace">Tokenizer</a></div>
</li>
<li>
<div class="menu-item"><a href="./api/undomanager.html" class="menuLink namespace">UndoManager</a></div>
</li>
<li>
<div class="menu-item"><a href="./api/virtual_renderer.html" class="menuLink namespace">VirtualRenderer</a></div>
</li>
</ul>
</div>
</div>
</div>
<div id="apiHolder">
<div id="documentation" class="span7">
<h1>Ace API Reference</h1>
<p>Welcome to the Ace API Reference!</p>
<p>On the left, you'll find a list of all of our currently documented classes.
These is not a complete set of classes, but rather, the "core" set. For more
information on how to work with Ace, check out the <a href="#nav=embedding">embedding guide</a>.
</p>
<p>Below is an ERD diagram describing some fundamentals about how the internals of Ace works:</p>
<img lazy-src="doc/template/resources/images/Ace_ERD.png" style="max-width:100%; max-height:100%" />
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="production">
<h1>Projects Using Ace</h1>
<p>Ace is used all over the web in all kinds of production applications. Here is
just a small sampling:</p>
<ul class="menu-list" style="overflow: hidden;">
<li>
<div style="height: 100%;background: url(https://a0.awsstatic.com/main/images/logos/aws_smile-header-desktop-en-white_59x35@2x.png) no-repeat 0 7px/100px;"></div>
<a href="https://aws.amazon.com/">AWS</a>
</li>
<li>
<img lazy-src="doc/site/images/khan-logo.png"
style="left: -10px; top: -27px; width: 120px" />
<a href="http://ejohn.org/blog/introducing-khan-cs/">Khan Academy</a>
</li>
<li>
<img lazy-src="doc/site/images/cloud9-logo.png"
style="left: -11px;top:-12px; width:122px" />
<a href="https://github.com/ajaxorg/cloud9">Cloud9 IDE</a>
</li>
<li>
<img lazy-src="doc/site/images/codecademy-logo.png"
style="left: -5px; top: 10px;" />
<a href="http://www.codecademy.com/">Codecademy</a>
</li>
<li>
<img lazy-src="doc/site/images/rstudio_logo_64.png"
style="left: 19px; top: 2px;" />
<a href="http://rstudio.org/">RStudio</a>
</li>
<li>
<img lazy-src="https://zedapp.s3.amazonaws.com/uploads/2014/02/zed-small.png" style="left: -1px;top: -20px;width: 103px;">
<a href="http://zedapp.org">Zed</a>
</li>
<li>
<img lazy-src="https://raw.githubusercontent.com/creationix/tedit/gh-pages/icons/icon-128.png"
style="width: 104px; left: -1px; top: -17px;">
<a href="https://github.com/creationix/tedit">Tedit</a>
</li>
<li>
<img lazy-src="https://upload.wikimedia.org/wikipedia/commons/6/63/Wikipedia-logo.png" style="left: -5px; top: -35px; width: 110px;">
<a href="https://en.wikipedia.org/wiki/Special:Version" style="font-family: 'Linux Libertine','Hoefler Text',Georgia,'Times New Roman',Times,serif;">W<span style="font-variant: small-caps;">ikipedi</span>A</a>
</li>
<li>
<img lazy-src="doc/site/images/codiad.png"
style="left: 10px; top: -4px; width:80px" />
<a href="http://codiad.com/">Codiad</a>
</li>
<li>
<img lazy-src="doc/site/images/shiftedit-logo.png"
style="left: -10px; top: -20px; width: 120px" />
<a href="http://shiftedit.net/">ShiftEdit</a>
</li>
<li>
<img lazy-src="doc/site/images/sassmeister-logo.png"
style="left: 10px;top: -5px;width: 80px;" />
<a href="http://sassmeister.com/">SassMeister</a>
</li>
<li>
<img lazy-src="doc/site/images/sx-logo.png"
style="left: -11px; top: -12px;">
<a href="http://www.scroipe.com">Scroipe</a>
</li>
<li>
<img lazy-src="doc/site/images/ideone-logo.png"
style="left: -5px; top: 20px;">
<a href="http://ideone.com">Ideone.com</a>
</li>
<li>
<div style="
background: url(https://lively-web.org/core/media/lively-web-logo.png) no-repeat;
position: absolute; left: -5px; height: 71px; width: 103px; background-size: 390px;
background-position: 19px;"></div>
<a href="http://lively-web.org">Lively Web</a>
</li>
<li>
<img lazy-src="doc/site/images/modx-logo-4.png"
style="left: 18px; top: 6px;">
<a href="http://modx.com/extras/package/ace">MODX</a>
</li>
<li>
<div class="rotating-logo" style="background:url(doc/site/images/habitat-logo.svg) center no-repeat;
left: 19px; top: 6px;width: 60px;height: 60px;background-size: 60px;position: relative;"></div>
<a href="http://habitat.inkling.com">Inkling Habitat</a>
</li>
<li style="width: 248px;">
<img lazy-src="https://codecombat.com/images/pages/base/logo.png" style="left: 0px; top: 1px; width: 248px">
<a href="http://codecombat.com">Code Combat</a>
</li>
<li>
<img lazy-src="https://papeeria.com/assets/all/images/papeeria_small.png" style="width: 95px; left: 2px; top: 8px;">
<a href="http://papeeria.com">Papeeria</a>
</li>
<li>
<img lazy-src="https://www.codingame.com/blog/wp-content/uploads/2016/11/logo_codingame_hud.png"
style="left: -15px;top: 27px;width: 127px;background: black;" />
<a href="https://www.codingame.com">CodinGame</a>
</li>
<li>
<div class="text-logo">Dillinger</div>
<a href="http://dillinger.io/">Dillinger</a>
</li>
<li>
<div class="text-logo" style="margin-left: -14px;">CodeHelper</div>
<a href="http://www.gamedevhelper.com/">CodeHelper</a>
</li>
<li>
<div class="text-logo">Edicy</div>
<a href="http://www.edicy.com/blog/new-code-editor-for-creating-unique-website-designs">Edicy</a>
</li>
<li>
<div class="text-logo">pixelJET</div>
<a href="http://www.pixeljet.net/index.html">pixelJET</a>
</li>
<li>
<div class="text-logo">Orbit</div>
<a href="http://orbit.bonsaijs.org/">BonsaiJS playground</a>
</li>
<li>
<img lazy-src="https://approximatrix.com/static/images/simplytext/logo-long-white.png"
style="width: 106px; left: -4px; top: 26px;">
<a href="http://approximatrix.com/products/simplytext">Simply Text</a>
</li>
<li>
<div class="text-logo" style="font-size: 18px;">ACEView</div>
<a href="https://github.com/faceleg/ACEView">ACEView</a>
</li>
<li>
<div class="text-logo" style="margin-left:-12px;">BootTheme</div>
<a href="http://www.boottheme.com/">BootTheme</a>
</li>
<li>
<img lazy-src="https://codebender.cc/images/codebender-transparent.png"
style="left: -9px; width: 117px;top: -22px;">
<a href="http://codebender.cc/">Codebender</a>
</li>
<li>
<div class="text-logo" style="margin-left:-5px;">Debuggex</div>
<a href="http://www.debuggex.com">Debuggex</a>
</li>
<li>
<script>
ace.require("ace/lib/dom").importCssStylsheet("https://fonts.googleapis.com/css?family=Henny+Penny", document);
</script>
<div class="text-logo" style="margin-left:-17px;font-family:'Henny Penny',cursive;">ChocolateJs</div>
<a href="https://chocolatejs.org">Chocolatejs</a>
</li>
<li>
<img lazy-src="https://playir.com/common/icon_playir.png"
style="left: 11px; width: 96px;top: -17px;">
<a href="http://playir.com">Playir</a>
</li>
<li>
<div class="text-logo" style="font-size: 23px;">Runnable</div>
<a href="http://runnable.com">Runnable</a>
</li>
<li>
<img lazy-src="https://joshnuss.github.io/mruby-web-irb/images/favicon.png"
style="left: 4px; width: 90px;top: -17px;">
<a href="http://joshnuss.github.io/mruby-web-irb/">Mruby-web-irb</a>
</li>
<li>
<div class="text-logo" style="margin-left:0px;">Jetstrap</div>
<a href="http://jetstrap.com/">Jetstrap</a>
</li>
<li title="WebRTC based video chat + code editor">
<div class="text-logo" style="font-size: 18px;">(codassium);</div>
<a href="http://codassium.com/">(codassium);</a>
</li>
<li>
<div style="font-size:50px" class="text-logo">t<span style="color:green">p<span></div>
<a href="https://www.tutorialspoint.com/online_html_editor.php">tutorialspoint</a>
</li>
<li title="Online conference and code review tool">
<div style="width: 90px; left: 10px; top: 0px;background:rgb(24,73,92);color: white;position: absolute;
font-size: 68px;text-align: center;font-weight: bold;font-family: inherit;line-height: normal;">sT</div>
<a href="http://sourcetalk.net/">SourceTalk</a>
</li>
<li>
<div class="text-logo" style="margin-top:4px">Run PHP Code</div>
<a href="https://github.com/websiteduck/Run-PHP-Code">RunPHPCode</a>
</li>
<li>
<img lazy-src="https://cloudcmd.io/img/logo/cloudcmd.png"
style="width: 108px; left: -4px; top: -2px;">
<a href="http://cloudcmd.io">Cloud Commander</a>
</li>
<li>
<div class="text-logo">NapCat</div>
<a href="http://napcatapp.tumblr.com/post/60598006734/version-1-3-is-released">NapCat</a>
</li>
<li>
<div style="color:orange;font-size:50px" class="text-logo">OJ</div>
<a href="http://ojjs.org/index.html">OJjs</a>
</li>
<li>
<div style="color:green;font-size:50px" class="text-logo">&lt;/&gt;</div>
<a href="https://thlorenz.github.io/scriptie-talkie/">Scriptie-Talkie</a>
</li>
<li>
<div class="text-logo">md</div>
<a href="https://thlorenz.github.io/browserify-markdown-editor/">browserify-markdown-editor</a>
</li>
<li>
<!-- <img src="https://www.siteleaf.com/images/logo.svg" style="left: 20px; top: -15px; width: 60px;"> -->
<a href="https://www.siteleaf.com/">Siteleaf</a>
</li>
<li>
<div class="" style="
background: url(https://colorsublime.github.io/assets/img/ColorSublime_logo.png);
position: absolute;height: 65px;width: 99px;
background-size: 310px 128px;background-position: 210px top;
"></div>
<a href="https://colorsublime.github.io/">ColorSublime</a>
</li>
<li>
<div style="
background: url(https://s3.amazonaws.com/spark-website/spark.png) no-repeat;
position: absolute; height: 65px; width: 83px; background-size: 200px 65px;
background-position: 19px;"></div>
<a href="http://spark.io/build">Spark Core</a>
</li>
<li>
<img lazy-src="https://2.gravatar.com/avatar/021e207e86fe81a7d81c67ef1ff38a0c" style="left: 11px; top: -5px;">
<a href="http://owncloud.org">ownCloud</a>
</li>
<li>
<!-- <img src="https://www.ezoui.com/prod/images/EZo_logo.png" style="left: 11px; top: -5px;"> -->
<a href="http://jqmdesigner.appspot.com">JQM Designer</a>
</li>
<li>
<div class="text-logo">qooxdoo</div>
<a href="http://demo.qooxdoo.org/devel/playground/#">Qooxdoo playground</a>
</li>
<li>
<div class="text-logo">ShareJS</div>
<a href="http://sharejs.org/hello-ace.html">ShareJS</a>
</li>
<li>
<div style="
background: url(https://www.pythonanywhere.com/static/anywhere/images/logo-234x35.png) no-repeat;
position: absolute; height: 65px; width: 94px; background-size: 234px 35px;
background-position: 19px;"></div>
<a href="http://www.pythonanywhere.com/">PythonAnywhere</a>
</li>
<li>
<!-- <img src="https://asciidocfx.com/images/logo.png" style="width: 75px; left: 12px; top: 0px;"> -->
<a href="http://asciidocfx.com/">Asciidoc FX</a>
</li>
<li>
<img lazy-src="https://octobercms.com/themes/website/assets/images/october.png" style="width: 95px; left: 2px; top: -17px;">
<a href="http://octobercms.com">October CMS</a>
</li>
<li style="width: 248px;">
<img lazy-src="https://www.codeavengers.com/image/RedLogoSmall.png" style="width: 248px; top: 30px;">
<a href="http://www.codeavengers.com/image/RedLogoSmall.png">Code Avengers</a>
</li>
<li>
<div style="font-size:23px" class="text-logo">{dev<span style="color:#ef4423">un</span>ity}</div>
<a href="http://devunity.com/">Devunity</a>
</li>
<li style="width: 248px;">
<img lazy-src="https://d2j5eocv5gptnv.cloudfront.net/assets/non_game_misc/site_header_logo.png?v=2" style="width: 238px; top: 15px; left: 5px">
<a href="http://www.codemonkey.co.il/">CodeMonkey</a>
</li>
<li>
<img lazy-src="https://funprogramming.org/i/fun_programming_logo_for_ace.png" style="width: 75px; left: 12px; top: -5px;">
<a href="http://funprogramming.org">Fun Programming</a>
</li>
</li>
<li>
<img lazy-src="https://lh4.ggpht.com/hG5bDu1GBXwxpPnrgPcAmTNQyZK4ICBDC9aeLNmMZahEYQOz_2vYT6sBqLNGLIGPopWjdveEvPuM9NBuErUSLQ=s60" style="width: 75px; left: 12px; top: -5px;">
<a href="http://bootzee.com">Bootzee</a>
</li>
<li>
<img lazy-src="https://www.branchcms.com/layout/images/branch-brand-logo-2.png" style="width: 125px; left: -12px; top: 15px;">
<a href="http://www.branchcms.com/blog/post/new-code-editor-ace">Branch CMS</a>
</li>
<li>
<!-- <img src="https://neocities.org/assets/img/cat.png" style="width: 95px; left: 2px; top: 0px;"> -->
<a href="https://neocities.org">Neocities</a>
</li>
<li>
<!-- <img src="https://webftp.selfbuild.fr/images/logo/logo_128.png" style="width: 95px; left: 2px; top: -17px;"> -->
<a href="http://webftp.selfbuild.fr">SelfBuild </a>
</li>
<li>
<!-- <img src="https://sbp.selfbuild.fr/sbp.png" style="width: 95px; left: 2px; top: -8px;"> -->
<a href="http://sbp.selfbuild.fr/">SBP</a>
</li>
<li>
<!-- <img src="https://eseecode.com/web/sites/eseecode.com/files/favicon.png" style="width: 100px; left: 0px; top: -20px;"> -->
<a href="http://eseecode.com/">eSeeCode</a>
</li>
<li>
<img lazy-src="https://codinghire.com/static/img/twitter.png" style="width: 80px; left: 10px; top: -3px;">
<a href="https://codinghire.com/">Coding Hire</a>
</li>
<li>
<div style=""></div>
<a href="http://apiary.io/">Apiary</a>
</li>
<li>
<!-- <img src="https://exist-db.org/exist/apps/eXide/resources/images/logo.png" style="width: 120px; left: -10px; top: 15px;"> -->
<a href="http://exist-db.org">ExistDB</a>
</li>
<li>
<img lazy-src="https://jscalc.io/img/icons/jscalc_full_bleed_24.svg" style="width: 90px; left: 5px; top: -10px;">
<a href="https://jscalc.io/">JSCalc</a>
</li>
<li>
<img lazy-src="https://www.gestixi.com/assets/img/icons/gestixi-64.png" style="width: 90px; left: 5px; top: 20px;">
<a href="https://www.gestixi.com/">GestiXi</a>
</li>
<li>
<div class="text-logo" style="font-size:22px;text-shadow:none;margin-top:13px">Code-Fight.Club</div>
<a href="http://code-fight.club">Code-Fight.Club</a>
</li>
<li>
<a href="http://www.wavemaker.com/">WaveMaker</a>
</li>
<li>
<div class="text-logo">Semantic Ui</div>
<a href="http://semantic-ui.com/">Semantic Ui</a>
</li>
<li>
<div class="text-logo">tmpltr</div>
<a href="http://rocktronica.github.io/tmpltr/">tmpltr</a>
</li>
<li>
<div class="text-logo">Git-Edit</div>
<a href="https://github.com/krispo/git-edit">Git-Edit</a>
</li>
<li>
<a href="http://codebender.cc/">Codebender</a>
</li>
<li>
<a href="http://beautifytools.com/">BeautifyTools</a>
</li>
<li>
<div class="text-logo">trinket</div>
<a href="https://trinket.io/">trinket</a>
</li>
<li>
<a href="https://goonlinetools.com/">GoOnlineTools</a>
</li>
<li>
<img lazy-src="https://sqlize.online/favicons/sqlize/android-chrome-192x192.png" style="width: 72px; left: 15px; top: 0px;">
<a href="https://sqlize.online/">SQLize.online</a>
</li>
<li>
<img lazy-src="https://phpize.online/favicons/phpize/android-chrome-192x192.png" style="width: 72px; left: 15px; top: 0px;">
<a href="https://phpize.online/">PHPize.online</a>
</li>
<li>
<div class="text-logo">Domoticz</div>
<a href="https://www.domoticz.com/">Domoticz</a>
</li>
<li>
<img lazy-src="https://nixx.dev/static/hotlink-ok/logo-alt.png" style="width: 72px; left: 15px; top: 0px;">
<a href="https://nixx.dev">Nixx Web Tools</a>
</li>
<li id="add_your_site">
<p>+</p>
<a href="https://github.com/ajaxorg/ace/issues/new?assignees=&labels=website%2Cneeds-triage&projects=&template=add-to-website.yml&title=Add+project+%28project+name%29+to+the+list+of+projects+using+Ace+on+its+website">Your Site Here</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js"></script>
<script src="./doc/template/resources/javascripts/bbq.js"></script>
<script src="./doc/site/js/main.js"></script>
<script defer src="./doc/site/js/ga.js"></script>
</body>
</html>