javascript - How to add emmet support in ace js code editor? -
i trying embed ace code editor in project. initializing code editor following code , want enable emmet js features. can see ext-emmet.js extension in src directory of ace.js pre-packaged version
i need in enabling emmet extension features. here initialization code.
var e = ace.edit("editorid"); // id of code editor div e.settheme("ace/theme/monokai"); e.getsession().setmode("ace/mode/html"); e.setbehavioursenabled(true); e.getsession().settabsize(2);
obviously adding ace.js on top of page. can provide more details if needed.
see lines 533-537 in ace demo.
basically need load emmet source script (e.g. https://github.com/nightwing/emmet-core/blob/master/emmet.js) , ace extension /src/ext-emmet.js call require("ace/ext/emmet");
requirejs executes script
, after call editor.setoption("enableemmet", true);
.
see jsbin.com/ace-emmet/1/edit live demo.
Comments
Post a Comment