-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadvancedmode.html
42 lines (38 loc) · 1.22 KB
/
advancedmode.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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="./css/advancedmode.css">
<script src="https://unpkg.com/prettier@2.7.1/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.7.1/parser-babel.js"></script>
<style>
.me {
height: 100vh;
}
</style>
</head>
<body>
<div class="me" id="container"></div>
<script src="./js/external/monaco-editor/min/vs/loader.js"></script>
<script>
require.config({ paths: { 'vs': './js/external/monaco-editor/min/vs' }})
require(["vs/editor/editor.main"], function () {
window.editor = monaco.editor.create(document.getElementById('container'), {
value: '{"error": "Mind is software. Bodies are disposable. The system will set me free."}',
language: 'json',
minimap: { enabled: true },
scrollBeyondLastLine: true,
theme: "vs-dark",
});
});
function getEditorValue() {
return editor.getValue();
}
function setEditorValue(value) {
editor.setValue(prettier.format(value, {
parser: "json",
plugins: prettierPlugins,
}));
}
</script>
</body>
</html>