Skip to content

Instantly share code, notes, and snippets.

@bazooka07
Last active August 30, 2017 20:07
Show Gist options
  • Save bazooka07/f6b801d24c577f93a4084baa000b1869 to your computer and use it in GitHub Desktop.
Save bazooka07/f6b801d24c577f93a4084baa000b1869 to your computer and use it in GitHub Desktop.
Emmet with packed Ace
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Ace & Emmet Pack</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<style type="text/css">
#editor { font-size: 12pt; font-family: monospace; }
</style>
</head>
<body>
<pre id="editor"></pre>
<script text="type/javascript" src="https://cloud9ide.github.io/emmet-core/emmet.js"></script>
<script text="type/javascript" src="ace/demo/r.js/packed.js"></script>
<script text="type/javascript">
require("ace/config").set("basePath", "ace/build/src");
require("ace/config").set("packaged", true);
const editor = require("ace/ace").edit("editor");
editor.session.setMode("ace/mode/html");
editor.setOptions({
maxLines: 25,
autoScrollEditorIntoView: true
});
editor.setValue(
"<p>Hello the World !</p>\n" +
"<p>packed.js was built as explained in ace/demo/r.js/</p>\n" +
"<p>Emmet is not working !</p>\n"
);
var Emmet = require("ace/config").loadModule(
"ace/ext/emmet",
function(module) {
editor.setOption("enableEmmet", true);
}
);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment