|
6 | 6 | <link href="https://cdn.nextjournal.com/data/QmW53nJSRrRao5FZ9sZ2pwQ4Gd4mK4nZcvhrATVdiabPkc?filename=tailwind-a4c8a6fe636b6d528505c30cb68526a024f446a7.css&content-type=text/css" rel="stylesheet">
|
7 | 7 | <link href="https://cdn.nextjournal.com/data/QmSaHZCU6U2DeNohfW2PuXDHkayw7w21uvUWL5oEqVWKwH?filename=viewer-1c61aac61ffa4da89b828d538c5e4eff188e7b56.css&content-type=text/css" rel="stylesheet">
|
8 | 8 | <link href="https://cdn.nextjournal.com/data/QmZZpjcdZDa8WT27QpcepDfqwuGik6Y3Ueyxaxs1Gqpk9w?filename=nextjournal-c81d440c5a7312046bbc5a2c3f2c5567d9ea9131.css&content-type=text/css" rel="stylesheet">
|
| 9 | + <script src="https://twemoji.maxcdn.com/v/latest/twemoji.min.js" crossorigin="anonymous"></script> |
9 | 10 | <style>
|
10 | 11 | /* Use Fira Mono without having to clutter up the demo with a custom CM theme. */
|
11 | 12 | .cm-scroller { font-family: var(--code-font) !important; }
|
| 13 | + .kbd { |
| 14 | + box-shadow: 0 2px 2px rgba(0,0,0,.1); |
| 15 | + background: white; |
| 16 | + border: 1px solid rgba(0,0,0,.15); |
| 17 | + border-radius: 3px; |
| 18 | + font-size: 0.75em; |
| 19 | + padding: 2px 5px; |
| 20 | + position: relative; |
| 21 | + top: -2px; |
| 22 | + font-family: var(--code-font); |
| 23 | + text-transform: uppercase; |
| 24 | + } |
| 25 | + img.emoji { |
| 26 | + height: 1em; |
| 27 | + width: 1em; |
| 28 | + margin: 0 .05em 0 .1em; |
| 29 | + vertical-align: -0.1em; |
| 30 | + display: inline-block; |
| 31 | + } |
| 32 | + .cta img.emoji { |
| 33 | + margin-right: 0.3em; |
| 34 | + } |
| 35 | + @media (max-width: 800px) { |
| 36 | + .ctas { |
| 37 | + font-size: 1rem !important; |
| 38 | + } |
| 39 | + } |
| 40 | + @media (max-width: 500px) { |
| 41 | + .ctas { |
| 42 | + flex-direction: column; |
| 43 | + } |
| 44 | + .ctas .cta { |
| 45 | + margin-bottom: 0.5rem; |
| 46 | + } |
| 47 | + } |
12 | 48 | </style>
|
13 | 49 | </head>
|
14 | 50 | <body>
|
|
17 | 53 | <div>
|
18 | 54 | <h1>Clojure/Script mode for <a href="https://codemirror.net/6/">CodeMirror 6</a></h1>
|
19 | 55 | <p>
|
20 |
| - Enable a decent Clojure/Script editor experience in the browser. |
21 |
| - Implemented as a <a href="https://lezer.codemirror.net">lezer</a> grammar. |
22 |
| - Built by <a href="https://nextjournal.com">Nextjournal</a>. |
| 56 | + Enable a decent Clojure/Script editor experience in the browser.<br> |
| 57 | + Built for and by <a href="https://nextjournal.com">Nextjournal</a>. |
23 | 58 | </p>
|
24 | 59 | <div class="ctas">
|
25 | 60 | <a href="https://github.com/nextjournal/clojure-mode" class="cta">
|
26 |
| - 🐙 Clone on GitHub |
| 61 | + 🐙 Clone on GitHub |
27 | 62 | </a>
|
28 | 63 | <a href="https://nextjournal.com/try/clojure?cm6=1" class="cta">
|
29 | 64 | 🤹♀️ Try in Nextjournal
|
30 | 65 | </a>
|
| 66 | + <a href="#use-it" class="cta"> |
| 67 | + 📦 Use it |
| 68 | + </a> |
31 | 69 | </div>
|
32 |
| - |
33 | 70 | </div>
|
34 | 71 | </div>
|
35 | 72 | </div>
|
36 |
| - <div class="bg-alt pb-12 px-6 pt-3"> |
37 |
| - <div class="max-w-4xl mx-auto"> |
38 |
| - <div id="editor"></div> |
| 73 | + <div class="bg-alt pb-12 px-6 pt-12 mt-6"> |
| 74 | + <h2 id="try-it" class="mt-0 mb-12 text-center text-3xl font-bold"> |
| 75 | + <a href="#try-it" class="near-black">🤹♀️ Try it for yourself</a> |
| 76 | + </h2> |
| 77 | + <div class="flex flex-col-reverse md:flex-row"> |
| 78 | + <div class="md:w-1/2 flex-shrink-0 md:px-6 mt-12 md:mt-0"> |
| 79 | + <h3 class="text-center sans-serif font-bold text-lg mt-0 mb-1">Try evaluating any of these forms with <span class="kbd alt font-normal">Alt</span> <span class="font-normal">+</span> <span class="kbd font-normal">⏎</span> !</h3> |
| 80 | + <p class="sans-serif text-sm text-center mb-6 mt-0"> |
| 81 | + In-browser eval is powered by <a href="https://github.com/borkdude/sci">Sci</a>. |
| 82 | + </p> |
| 83 | + <div id="editor"></div> |
| 84 | + </div> |
| 85 | + <div class="md:w-1/2 flex-shrink-0 md:px-6 sans-serif"> |
| 86 | + <ul class="text-lg"> |
| 87 | + <li class="pr-12 flex"> |
| 88 | + <span class="mr-2">⚡️</span> |
| 89 | + <div class="flex-auto"> |
| 90 | + <span class="font-bold">Lightning-fast</span> with <a href="https://lezer.codemirror.net">lezer incremental parsing</a><br> |
| 91 | + <span class="text-sm"> |
| 92 | + Copy <a href="https://raw.githubusercontent.com/clojure/clojure/master/src/clj/clojure/core.clj" target="_blank"><code>clojure/core.clj</code></a> into 👈 <span class="ml-1">to try!</span> |
| 93 | + </span> |
| 94 | + </div> |
| 95 | + </li> |
| 96 | + <li class="mt-4 flex"> |
| 97 | + <span class="mr-2">🥤</span> |
| 98 | + <div class="flex-auto"> |
| 99 | + <span class="font-bold">Slurping & 🤮 Barfing</span> |
| 100 | + <table class="w-full md:max-w-sm text-sm"> |
| 101 | + <tbody> |
| 102 | + <tr class="align-top"> |
| 103 | + <td class="py-1">forward</td> |
| 104 | + <td class="py-1 text-right"> |
| 105 | + <span class="kbd ctrl">Ctrl</span> + <span class="kbd">←</span> / <span class="kbd">→</span> |
| 106 | + </td> |
| 107 | + <td class="py-1 text-right"> |
| 108 | + <span class="mx-1">or</span> <span class="kbd mod">Mod</span> + <span class="kbd">⇧</span> + <span class="kbd">j</span> / <span class="kbd">k</span> |
| 109 | + </td> |
| 110 | + </tr> |
| 111 | + <tr class="border-t"> |
| 112 | + <td class="py-1 pr-12">backward</td> |
| 113 | + <td class="py-1 text-right"> |
| 114 | + <span class="kbd ctrl">Ctrl</span> + <span class="kbd alt">Alt</span> + <span class="kbd">←</span> / <span class="kbd">→</span> |
| 115 | + </td> |
| 116 | + <td></td> |
| 117 | + </tr> |
| 118 | + </tbody> |
| 119 | + </table> |
| 120 | + </div> |
| 121 | + </li> |
| 122 | + <li class="mt-4 flex"> |
| 123 | + <span class="mr-2">💗</span> |
| 124 | + <div class="flex-auto"> |
| 125 | + <span class="font-bold">Semantic Selections</span> |
| 126 | + <table class="w-full md:max-w-sm text-sm"> |
| 127 | + <tbody> |
| 128 | + <tr> |
| 129 | + <td class="py-1" style="width: 150px;">Expand / Contract</td> |
| 130 | + <td class="py-1 text-right" style="width: 125px;"> |
| 131 | + <span class="kbd alt">Alt</span> + <span class="kbd">↑</span> / <span class="kbd">↓</span> |
| 132 | + </td> |
| 133 | + <td class="py-1 text-right"> |
| 134 | + <span class="mx-1">or</span> <span class="kbd mod">Mod</span> + <span class="kbd">1</span> / <span class="kbd">2</span> |
| 135 | + </td> |
| 136 | + </tr> |
| 137 | + </tbody> |
| 138 | + </table> |
| 139 | + </div> |
| 140 | + </li> |
| 141 | + <li class="mt-4 flex"> |
| 142 | + <span class="mr-2">🧙</span> |
| 143 | + <div class="flex-auto"> |
| 144 | + <span class="font-bold">Evaluation</span> |
| 145 | + <table class="w-full md:max-w-sm text-sm"> |
| 146 | + <tbody> |
| 147 | + <tr> |
| 148 | + <td class="py-1 pr-12"> |
| 149 | + At Cursor |
| 150 | + </td> |
| 151 | + <td class="py-1 text-right"> |
| 152 | + <span class="kbd alt">Alt</span> + <span class="kbd">⏎</span> |
| 153 | + </td> |
| 154 | + </tr> |
| 155 | + <tr class="border-t"> |
| 156 | + <td class="py-1 pr-12"> |
| 157 | + Top-level form |
| 158 | + </td> |
| 159 | + <td class="py-1 text-right"> |
| 160 | + <span class="kbd alt">Alt</span> + <span class="kbd">⇧</span> + <span class="kbd">⏎</span> |
| 161 | + </td> |
| 162 | + </tr> |
| 163 | + <tr class="border-t"> |
| 164 | + <td class="py-1 pr-12"> |
| 165 | + Cell |
| 166 | + </td> |
| 167 | + <td class="py-1 text-right"> |
| 168 | + <span class="kbd mod">Mod</span> + <span class="kbd">⏎</span> |
| 169 | + </td> |
| 170 | + </tr> |
| 171 | + </tbody> |
| 172 | + </table> |
| 173 | + </div> |
| 174 | + </li> |
| 175 | + <li class="mt-4 flex"> |
| 176 | + <span class="mr-2">🧹</span> |
| 177 | + <div class="flex-auto"> |
| 178 | + <span class="font-bold">Autoformatting</span> |
| 179 | + <p class="mt-1 text-sm"> |
| 180 | + following <a href="https://tonsky.me/blog/clojurefmt/">Tonsky’s Better Clojure Formatting</a> |
| 181 | + </p> |
| 182 | + </div> |
| 183 | + </li> |
| 184 | + </ul> |
| 185 | + </div> |
39 | 186 | </div>
|
40 |
| - <div class="max-w-4xl mx-auto"> |
41 |
| - <div id="docs" class="border-t-0 overflow-auto text-md p-0 m-0 mt-4 sans-serif"></div> |
| 187 | + </div> |
| 188 | + <div class="max-w-4xl mx-auto py-12 px-6"> |
| 189 | + <div id="docs" class="border-t-0 overflow-auto text-md p-0 m-0 sans-serif"></div> |
| 190 | + </div> |
| 191 | + <div class="bg-alt py-12 px-6"> |
| 192 | + <div id="use-it" class="mx-auto max-w-4xl"> |
| 193 | + <h2 class="mt-0 mb-8 text-3xl font-bold text-center"> |
| 194 | + <a href="#use-it" class="near-black">📦 Use it in your project</a> |
| 195 | + </h2> |
| 196 | + <pre clojure-mode="true" class="max-w-4xl mx-auto"> |
| 197 | +{:deps {nextjournal.clojure-mode {:git/url "https://github.com/nextjournal/clojure-mode" |
| 198 | + :sha "SHA"}}} |
| 199 | + </pre> |
42 | 200 | </div>
|
43 | 201 | </div>
|
44 | 202 | <div class="border-t-2 px-6">
|
|
0 commit comments