如何在我的网站中嵌入 ace 编辑器
How to embed ace editor in my website
伙计们,最近我一直在使用 cloud9 ide,我想将 ace 编辑器添加到我的网站。要查看 ace 编辑器,这里是 link:http://ace.c9.io/#nav=about
谁能告诉我如何将它嵌入我的网站。看不懂ace编辑器首页给的教程
感谢所有帮助。
嵌入到您的网站上清楚地显示在网站上:
http://ace.c9.io/#nav=embedding
示例:
<!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
如果您使用的是cloud9 IDE,您可以通过..
下载编辑器
- Github:
git clone git://github.com/ajaxorg/ace.git
- 凉亭:
bower install --save git clone git://github.com/ajaxorg/ace.git
注意:您需要构建项目。
如果你想使用预建的,请改用这个:
https://github.com/ajaxorg/ace-builds.git
例子
这是我对 ace-editor 的设置:
https://ide.c9.io/anik786/cloud-9-sandbox
伙计们,最近我一直在使用 cloud9 ide,我想将 ace 编辑器添加到我的网站。要查看 ace 编辑器,这里是 link:http://ace.c9.io/#nav=about
谁能告诉我如何将它嵌入我的网站。看不懂ace编辑器首页给的教程
感谢所有帮助。
嵌入到您的网站上清楚地显示在网站上: http://ace.c9.io/#nav=embedding
示例:
<!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
如果您使用的是cloud9 IDE,您可以通过..
下载编辑器- Github:
git clone git://github.com/ajaxorg/ace.git
- 凉亭:
bower install --save git clone git://github.com/ajaxorg/ace.git
注意:您需要构建项目。
如果你想使用预建的,请改用这个:
https://github.com/ajaxorg/ace-builds.git
例子 这是我对 ace-editor 的设置: https://ide.c9.io/anik786/cloud-9-sandbox