ace编辑html,ace自定义在线编辑器方法及提示

ace是一款优秀的开源在线代码编辑器

github下载地址:https://github.com/ajaxorg/ace

下载源码>打开命令行窗口- git clone https://github.com/ajaxorg/ace.git

2.进入ace-demo目录,每个html页面有不同的功能,可以自己测试看一下。

但是打开autocompletion.html页面时,报错如下

couldn't find ace.js file,

to build it run node Makefile.dryice.js full

是因为我们需要编译ace源码。

3.编译ace源码。查看ace根目录下的Readme.md文件,按如下方式进行编译。

Building Ace

-----------

You do not generally need to build ACE. The [ace-builds repository](https://github.com/ajaxorg/ace-builds/) endeavours to maintain the latest build, and you can just copy one of _src*_ subdirectories somewhere into your project.

However, all you need is Node.js and npm installed to package ACE. Just run `npm install` in the ace folder to install dependencies:

```bash

npm install

node ./Makefile.dryice.js

4.更改autocompletion.html(自动提示+联想)文件

ACE Autocompletion demo

body {

overflow: hidden;

}

#editor {

margin: 0;

position: absolute;

top: 0;

bottom: 0;

left: 0;

right: 0;

}

 
 

// trigger extension

ace.require("ace/ext/language_tools");

var editor = ace.edit("editor");

editor.session.setMode("ace/mode/html");

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

// enable autocompletion and snippets

editor.setOptions({

enableBasicAutocompletion: true,

enableSnippets: true,

enableLiveAutocompletion: true

});

标签:github,自定义,ace,js,编辑器,html,editor,源码

来源: https://blog.csdn.net/kongxingxing/article/details/98481023

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值