-
Notifications
You must be signed in to change notification settings - Fork 3
/
example.html
58 lines (57 loc) · 1.53 KB
/
example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Emmet plugin for Monaco editor</title>
<link rel="stylesheet" data-name="vs/editor/editor.main"
href="./node_modules/monaco-editor/min/vs/editor/editor.main.css" />
<link rel="stylesheet" href="./src/style.css" />
<style>
#editor {
height: 300px;
border: 1px solid #000;
}
</style>
</head>
<body>
<h1>Emmet plugin for Monaco editor</h1>
<div id="editor"></div>
<script>
var require = { paths: { vs: './node_modules/monaco-editor/dev/vs' } };
</script>
<script src="./node_modules/monaco-editor/dev/vs/loader.js"></script>
<script src="./node_modules/monaco-editor/dev/vs/editor/editor.main.nls.js"></script>
<script src="./node_modules/monaco-editor/dev/vs/editor/editor.main.js"></script>
<script src="./dist/emmet.browser.js"></script>
<script>
const code = `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body {
padding: 10px;
}
</style>
</head>
<body>
<ul>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
</ul>
</body>
</html>
`;
var editor = monaco.editor.create(document.getElementById('editor'), {
value: code,
language: 'html'
});
emmet(editor);
</script>
</body>
</html>