From 26aff5b5146ea1de60ad2d754449fa69368e7d66 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Fri, 24 Feb 2023 11:17:59 +0100 Subject: [PATCH] Improves hello world example --- .../creating-the-editor/hello-world/sample.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.js b/website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.js index dedfd4e9..c68ae059 100644 --- a/website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.js +++ b/website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.js @@ -1,9 +1,10 @@ -// The Monaco Editor can be easily created, given an -// empty container and an options literal. -// Two members of the literal are "value" and "language". -// The editor takes the full size of its container. +const text = `function hello() { + alert('Hello world!'); +}`; +// Hover on each property to see its docs! monaco.editor.create(document.getElementById("container"), { - value: "function hello() {\n\talert('Hello world!');\n}", + value: text, language: "javascript", + automaticLayout: true, });