-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
68 lines (67 loc) · 4.36 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<html>
<!--
Adapted from https://github.com/babashka/scittle/blob/main/resources/public/codemirror.html
Note the addition of both the parinfer and diff-match-patch libraries.
-->
<head>
<script async src="https://ga.jspm.io/npm:es-module-shims@1.6.1/dist/es-module-shims.js"></script>
<script src="https://cdn.jsdelivr.net/npm/scittle@0.6.17/dist/scittle.js"></script>
<script>scittle.core.disable_auto_eval();</script>
<script src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/scittle@0.6.17/dist/scittle.reagent.js"></script>
<script src="https://cdn.jsdelivr.net/npm/scittle@0.6.17/dist/scittle.re-frame.js"></script>
<script src="https://cdn.jsdelivr.net/npm/scittle@0.6.17/dist/scittle.promesa.js"></script>
<script src="https://cdn.jsdelivr.net/npm/diff-match-patch-js-browser-and-nodejs@1.0.2/diff_match_patch.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/parinfer@3.12.0/parinfer.min.js"></script>
<script type="importmap">
{
"imports": {
"codemirror": "https://cdn.jsdelivr.net/npm/codemirror/dist/index.js",
"@codemirror/commands": "https://cdn.jsdelivr.net/npm/@codemirror/commands/dist/index.js",
"@codemirror/search": "https://cdn.jsdelivr.net/npm/@codemirror/search/dist/index.js",
"@codemirror/autocomplete": "https://cdn.jsdelivr.net/npm/@codemirror/autocomplete/dist/index.js",
"@codemirror/lint": "https://cdn.jsdelivr.net/npm/@codemirror/lint/dist/index.js",
"crelt": "https://cdn.jsdelivr.net/npm/crelt/index.es.js",
"@nextjournal/lang-clojure": "https://cdn.jsdelivr.net/npm/@nextjournal/lang-clojure/dist/index.js",
"@nextjournal/lezer-clojure": "https://cdn.jsdelivr.net/npm/@nextjournal/lezer-clojure/dist/index.es.js",
"@lezer/highlight": "https://cdn.jsdelivr.net/npm/@lezer/highlight/dist/index.js",
"@lezer/lr": "https://cdn.jsdelivr.net/npm/@lezer/lr/dist/index.js",
"@lezer/common": "https://cdn.jsdelivr.net/npm/@lezer/common/dist/index.js",
"@codemirror/commands": "https://cdn.jsdelivr.net/npm/@codemirror/commands/dist/index.js",
"@codemirror/language": "https://cdn.jsdelivr.net/npm/@codemirror/language/dist/index.js",
"@codemirror/lint": "https://cdn.jsdelivr.net/npm/@codemirror/lint/dist/index.js",
"@codemirror/state": "https://cdn.jsdelivr.net/npm/@codemirror/state/dist/index.js",
"@codemirror/view": "https://cdn.jsdelivr.net/npm/@codemirror/view/dist/index.js",
"style-mod": "https://cdn.jsdelivr.net/npm/style-mod/src/style-mod.js",
"w3c-keyname": "https://cdn.jsdelivr.net/npm/w3c-keyname/index.es.js"
}
}
</script>
<script type="module">
import * as codemirror from 'codemirror';
import * as cm_commands from '@codemirror/commands';
import * as cm_language from '@codemirror/language';
import * as cm_lint from '@codemirror/lint';
import * as cm_view from '@codemirror/view';
import * as cm_state from '@codemirror/state';
import * as lang_clojure from '@nextjournal/lang-clojure'
globalThis.codemirror = codemirror;
globalThis.cm_commands = cm_commands;
globalThis.cm_language = cm_language;
globalThis.cm_lint = cm_lint;
globalThis.cm_state = cm_state;
globalThis.cm_view = cm_view;
globalThis.lang_clojure = lang_clojure;
scittle.core.eval_script_tags();
</script>
<script type="application/x-scittle" src="cljs/scittle-cm6-parinfer.cljs"></script>
<script type="application/x-scittle" src="cljs/scittle-cm6-parinfer-demo.cljs"></script>
</head>
<body>
<h1>Parinfer in CodeMirror 6 demo</h1>
<div id="editor"></div>
<p>Experience <a href="https://shaunlebron.github.io/parinfer/">Parinfer</a> by typing Clojure code, pasting, indenting, deindenting and deleting code. Undo and redo work as they should.</p>
<p>Just like with <a href="https://github.com/nextjournal/clojure-mode">Nextjournal's CodeMirror 6 Clojure Mode</a> you can see that this still works fast (enough...?) with a large body of code, like <a href="https://raw.githubusercontent.com/clojure/clojure/refs/heads/master/src/clj/clojure/core.clj">clojure/core.clj</a>.</p>
</body>
</html>