How to embed ace editor in my website
11,146
Embedding to your website is clearly shown on the website: http://ace.c9.io/#nav=embedding
Example:
<!DOCTYPE html>
<html lang="en">
<head>
<title>ACE in Action</title>
<style type="text/css" media="screen">
#editor {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
</style>
</head>
<body>
<div id="editor">function foo(items) {
var x = "All this is syntax highlighted";
return x;
}</div>
<script src="/ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/javascript");
</script>
</body>
</html>
Cloud9 IDE
If your using the cloud9 IDE, you can download the editor via..
- Github:
git clone git://github.com/ajaxorg/ace.git
- Bower:
bower install --save git clone git://github.com/ajaxorg/ace.git
NOTE: you will need to build the project.
If you want to use the pre built ones use this instead:
https://github.com/ajaxorg/ace-builds.git
Example Here's my setup for the ace-editor: https://ide.c9.io/anik786/cloud-9-sandbox
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on June 04, 2022Comments
-
Admin about 2 years
Guys lately i have been using the cloud9 ide and i wanted to add the ace editor to me website. To view the ace editor, here is the link: http://ace.c9.io/#nav=about
Can someone please tell me how to embed it in my website. I cant understand the tutorial given on the homepage of the ace editor
All help is appreciated.
-
Admin almost 9 yearsThanks a ton bro it worked
-
JohnnyBizzle over 7 yearsUnfortunately this wipes out everything else you might want to show.
-
Stefan Steiger over 7 years@JohnnyBizzle: LoL, just change the css and remove the absolute.
-
Kraang Prime over 5 yearsI would hardly call
ace-builds
as built. Each feature is a separate file (such as autocomplete, etc). For language files, this is fine, but for every feature ?? Would be nice if there was a true "pre-built" version somewhere or a builder, or even instructions on how to "build" thepre-built
stuff into a single js. Their builder is rather lazy with lots of**/*.js
so the output is directed to the same messy structure as the input. -
Nic Scozzaro about 5 yearsHere's where the snippet above comes from: github.com/ajaxorg/ace-builds/blob/master/editor.html