You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
monaco-editor/electron-amd/electron-index.html

44 lines
1.1 KiB
HTML

5 years ago
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
5 years ago
<meta
http-equiv="Content-Security-Policy"
content="default-src 'none'; script-src file: 'sha256-eUe9D+bk6Fb37s7QPlaxhnIImIQEcnZ1gE7aRcB3yOM='; style-src 'unsafe-inline' file:; font-src file:"
/>
5 years ago
<title>Monaco Editor!</title>
5 years ago
<style>
#container {
width: 500px;
height: 300px;
border: 1px solid #ccc;
}
</style>
5 years ago
</head>
<body>
<h1>Monaco Editor in Electron (without nodeIntegration)!</h1>
Note: Since Electron without nodeIntegration is very similar to a browser,
you can have a look at all the other `browser-` samples, as they should work
just fine. <br /><br />
5 years ago
<div id="container"></div>
5 years ago
</body>
5 years ago
<script src="../node_modules/monaco-editor/min/vs/loader.js"></script>
5 years ago
<script>
require.config({ paths: { vs: '../node_modules/monaco-editor/min/vs' } });
require(['vs/editor/editor.main'], function () {
5 years ago
const editor = monaco.editor.create(
document.getElementById('container'),
{
value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join(
'\n'
),
language: 'javascript'
}
);
5 years ago
});
</script>
</html>