Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { defaultKeymap } from "https://esm.sh/@codemirror/commands";
import { sql } from "https://esm.sh/@codemirror/lang-sql";
import { EditorState } from "https://esm.sh/@codemirror/state";
import { EditorView, keymap } from "https://esm.sh/@codemirror/view";
let startState = EditorState.create({
doc: "Hello World",
extensions: [keymap.of(defaultKeymap)],
});
let view = new EditorView({
state: startState,
parent: document.body,
});
February 19, 2024