Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions public/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -20629,19 +20629,15 @@ var jule = StreamLanguage.define({
}
});
var helloWorldCode = `fn main() {
println("Hello World!")
println("Hello World!")
}`;
var editor = new EditorView({
doc: helloWorldCode,
extensions: [
basicSetup,
jule,
syntaxHighlighting(style),
keymap.of([indentWithTab]),
EditorView.theme({
"&": { maxHeight: "200px" },
".cm-scroller": { overflow: "auto" }
})
keymap.of([indentWithTab])
],
parent: document.getElementById("editor")
});
Expand Down
30 changes: 17 additions & 13 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="icon" href="./static/icon.svg">
<link rel="stylesheet" href="./style.css">
<title>Jule Playground</title>
</head>
<body>
<h1>Jule Playground</h1>
<p>Wanna learn more about Jule? Check out the <a href="https://pgmtx.neocities.org/articles/jule_cheatsheet">cheatsheet</a> and the <a href="https://manual.jule.dev/">manual</a>.</p>
<select id="examples">
<option value="hello-world">Hello world</option>
<option value="fizzbuzz">Fizzbuzz</option>
<option value="randomness">Randomness</option>
<option value="comptime-matching">Comptime matching</option>
</select>
<div id="editor"></div>
<script type="module" src="./bundle.js"></script>
<button type="button" id="run-button">Run (Ctrl-Enter)</button>
<br>
<pre id="output">
<div id="top">
<h1>Jule Playground</h1>
<p>Wanna learn more about Jule? Check out the <a href="https://pgmtx.neocities.org/articles/jule_cheatsheet">cheatsheet</a> and the <a href="https://manual.jule.dev/">manual</a>.</p>
<select id="examples">
<option value="hello-world">Hello world</option>
<option value="fizzbuzz">Fizzbuzz</option>
<option value="randomness">Randomness</option>
<option value="comptime-matching">Comptime matching</option>
</select>
<div id="editor"></div>
</div>
<div id="output-wrapper">
<script type="module" src="./bundle.js"></script>
<button type="button" id="run-button">Run (Ctrl-Enter)</button>
<pre id="output">
clang version 21.1.2
jule0.2.0</pre>
</div>
</body>
</html>
6 changes: 1 addition & 5 deletions public/playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const jule = StreamLanguage.define({
});

const helloWorldCode = `fn main() {
println("Hello World!")
println("Hello World!")
}`;

const editor = new EditorView({
Expand All @@ -146,10 +146,6 @@ const editor = new EditorView({
jule,
syntaxHighlighting(style),
keymap.of([indentWithTab]),
EditorView.theme({
"&": { maxHeight: "200px" },
".cm-scroller": { overflow: "auto" },
}),
],
parent: document.getElementById("editor"),
});
Expand Down
3 changes: 3 additions & 0 deletions public/static/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 44 additions & 12 deletions public/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,69 @@

body {
font-family: "Inter", sans-serif;
height: 100vh;
margin-top: 0;
margin-bottom: 0;
display: flex;
flex-direction: column;
}

#top {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
}

select {
width: 11em;
margin-bottom: 8px;
}

#editor {
flex: 1;
min-height: 0;
}

.cm-editor {
height: 100%;
}

.cm-editor .cm-content {
font-family: "Monaspace Neon", Courier, monospace;
font-variant-ligatures: none;
}

button {
display: inline-block;
padding: 0.2em 0.9em;
line-height: 1.5em;
margin: 0.2em;
margin: 8px 8px 0.5em 0;
text-decoration: none;
font-size: 0.8em;
cursor: pointer;
border: 0px;
height: 2em;
color: #333;
border-radius: 4px;
width: 10em;
}

#output-wrapper {
height: 25vh;
display: flex;
flex-direction: column;
/*justify-content: flex-end; /* forces the div to be at the bottom of the page */
}

pre {
pre#output {
font-family: "Monaspace Neon", Courier, monospace;
background-color: rgb(230, 230, 230);
flex: 1;
padding: 1em;
border-radius: 5px;
margin: 0;
overflow-x: auto;
}

.cm-editor .cm-content {
font-family: "Monaspace Neon", Courier, monospace;
font-variant-ligatures: none;
}

#output {
font-family: "Monaspace Neon", Courier, monospace;
max-height: 300px;
overflow-y: auto;
min-height: 0;
}
Loading