<div id="random-id"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.44.0/min/vs/loader.min.js"></script>
<script>
require.config({ paths: { 'vs': 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.44.0/min/vs' }});
const randomId = Math.random().toString(36).substring(7);
const randomIdDiv = document.querySelector('#random-id');
randomIdDiv.id = randomId;
randomIdDiv.style.height = '130px';
randomIdDiv.style.border = '1px solid black';
require(["vs/editor/editor.main"], () => {
monaco.editor.create(document.getElementById(randomIdDiv.id), {
value: `print("wk-18k")`,
language: 'python',
theme: 'vs-dark',
fontSize: 20,
minimap: {
enabled: false,
},
scrollbar: {
horizontal: false,
vertical: false,
},
mouseWheelZoom: true,
});
});
</script>