saturn
- 187 commits
- 2 branches
- 0 tags
- updated
- CI 2/2
feat: add static code highlighting
SignedGitea couldn't verify the signature.
Showing 13 changed files with 1145 additions and 19 deletions.
.gitignore
+3 −0
@@ -9,3 +9,6 @@ dist/99social/.wrangler/1010social/.dev.vars1111social/node_modules/1213# scripts: deps14scripts/node_modules/
assets/fonts/geistmono/GeistMono-Italic.woff2added
+0 −0
Binary file, not shown.
assets/fonts/geistmono/GeistMono-Regular.woff2added
+0 −0
Binary file, not shown.
assets/fonts/geistmono/OFL.txtadded
+92 −0
@@ -0,0 +1,92 @@1Copyright (c) 2023 Vercel, in collaboration with basement.studio23This Font Software is licensed under the SIL Open Font License, Version 1.1.4This license is copied below, and is also available with a FAQ at:5http://scripts.sil.org/OFL67-----------------------------------------------------------8SIL OPEN FONT LICENSE Version 1.1 - 26 February 20079-----------------------------------------------------------1011PREAMBLE12The goals of the Open Font License (OFL) are to stimulate worldwide13development of collaborative font projects, to support the font creation14efforts of academic and linguistic communities, and to provide a free and15open framework in which fonts may be shared and improved in partnership16with others.1718The OFL allows the licensed fonts to be used, studied, modified and19redistributed freely as long as they are not sold by themselves. The20fonts, including any derivative works, can be bundled, embedded,21redistributed and/or sold with any software provided that any reserved22names are not used by derivative works. The fonts and derivatives,23however, cannot be released under any other type of license. The24requirement for fonts to remain under this license does not apply25to any document created using the fonts or their derivatives.2627DEFINITIONS28"Font Software" refers to the set of files released by the Copyright29Holder(s) under this license and clearly marked as such. This may30include source files, build scripts and documentation.3132"Reserved Font Name" refers to any names specified as such after the33copyright statement(s).3435"Original Version" refers to the collection of Font Software components as36distributed by the Copyright Holder(s).3738"Modified Version" refers to any derivative made by adding to, deleting,39or substituting -- in part or in whole -- any of the components of the40Original Version, by changing formats or by porting the Font Software to a41new environment.4243"Author" refers to any designer, engineer, programmer, technical44writer or other person who contributed to the Font Software.4546PERMISSION AND CONDITIONS47Permission is hereby granted, free of charge, to any person obtaining48a copy of the Font Software, to use, study, copy, merge, embed, modify,49redistribute, and sell modified and unmodified copies of the Font50Software, subject to the following conditions:51521) Neither the Font Software nor any of its individual components,53in Original or Modified Versions, may be sold by itself.54552) Original or Modified Versions of the Font Software may be bundled,56redistributed and/or sold with any software, provided that each copy57contains the above copyright notice and this license. These can be58included either as stand-alone text files, human-readable headers or59in the appropriate machine-readable metadata fields within text or60binary files as long as those fields can be easily viewed by the user.61623) No Modified Version of the Font Software may use the Reserved Font63Name(s) unless explicit written permission is granted by the corresponding64Copyright Holder. This restriction only applies to the primary font name as65presented to the users.66674) The name(s) of the Copyright Holder(s) or the Author(s) of the Font68Software shall not be used to promote, endorse or advertise any69Modified Version, except to acknowledge the contribution(s) of the70Copyright Holder(s) and the Author(s) or with their explicit written71permission.72735) The Font Software, modified or unmodified, in part or in whole,74must be distributed entirely under this license, and must not be75distributed under any other license. The requirement for fonts to76remain under this license does not apply to any document created77using the Font Software.7879TERMINATION80This license becomes null and void if any of the above conditions are81not met.8283DISCLAIMER84THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,85EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF86MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT87OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE88COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,89INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL90DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING91FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM92OTHER DEALINGS IN THE FONT SOFTWARE.
favicon.icoadded
+0 −0
Binary file, not shown.
global.css
+232 −10
@@ -67,7 +67,7 @@ h6 {6767}68686969/*============================*/70/* fonts - geist pixel square (one weight, no italic) */70/* fonts - geist pixel square (one weight, no italic), geist mono */7171/*============================*/72727373/* the weight range stops the browser faking bold */@@ -80,6 +80,23 @@ h6 {8080 font-display: swap;8181}828283/* geist mono, code blocks only: pixel type is proportional, so columns drift */84@font-face {85 font-family: "Geist Mono";86 src: url("./assets/fonts/geistmono/GeistMono-Regular.woff2") format("woff2");87 font-weight: 400;88 font-style: normal;89 font-display: swap;90}9192@font-face {93 font-family: "Geist Mono";94 src: url("./assets/fonts/geistmono/GeistMono-Italic.woff2") format("woff2");95 font-weight: 400;96 font-style: italic;97 font-display: swap;98}9983100/*============================*/84101/* tokens */85102/*============================*/@@ -106,6 +123,18 @@ html {106123 --rating-good: #bdbd7f;107124 --rating-above-average: #a9c94f;108125 --rating-great: #7ec98f;126127 /* syntax: same roles as the zed, helix and warp themes */128 --syn-fg: #c2c4ba;129 --syn-punct: #a2a49b;130 --syn-comment: #909585;131 --syn-keyword: #ad9be2;132 --syn-function: #6fb1d7;133 --syn-builtin: #7ac4ad;134 --syn-type: #ddc56c;135 --syn-variable: #e0775d;136 --syn-constant: #e7a86e;137 --syn-string: #a9b767;109138}110139111140/* other palettes, picked by theme.js; moss is the no-js default */@@ -115,6 +144,18 @@ html {115144 --borders: #133051;116145 --accent: #66a0c8;117146 --accent-muted: #1a4f8c;147148 /* syntax */149 --syn-fg: #bdc3ca;150 --syn-punct: #9ea4aa;151 --syn-comment: #838d98;152 --syn-keyword: #a79eec;153 --syn-function: #6fb2df;154 --syn-builtin: #73c6be;155 --syn-type: #dbc777;156 --syn-variable: #e0796e;157 --syn-constant: #eaa77c;158 --syn-string: #a2ba75;118159}119160120161[data-theme="wine"] {@@ -123,6 +164,18 @@ html {123164 --borders: #4f1b39;124165 --accent: #e47da8;125166 --accent-muted: #87285e;167168 /* syntax */169 --syn-fg: #cabfc4;170 --syn-punct: #a9a0a5;171 --syn-comment: #978790;172 --syn-keyword: #b896e2;173 --syn-function: #75afdd;174 --syn-builtin: #77c4b6;175 --syn-type: #ebbe6e;176 --syn-variable: #e57268;177 --syn-constant: #f0a17b;178 --syn-string: #b3b365;126179}127180128181[data-theme="plum"] {@@ -131,6 +184,18 @@ html {131184 --borders: #31234e;132185 --accent: #a699d0;133186 --accent-muted: #4f3685;187188 /* syntax */189 --syn-fg: #c3c1cb;190 --syn-punct: #a4a1aa;191 --syn-comment: #8c8897;192 --syn-keyword: #b19ee7;193 --syn-function: #7db1de;194 --syn-builtin: #7fc5c2;195 --syn-type: #e4c584;196 --syn-variable: #de7c7b;197 --syn-constant: #eba78c;198 --syn-string: #adb87b;134199}135200136201[data-theme="teal"] {@@ -139,6 +204,18 @@ html {139204 --borders: #143f3c;140205 --accent: #5abdac;141206 --accent-muted: #1c6c66;207208 /* syntax */209 --syn-fg: #bac5c4;210 --syn-punct: #9ca5a4;211 --syn-comment: #859794;212 --syn-keyword: #a59ee7;213 --syn-function: #6bb1da;214 --syn-builtin: #73c5b5;215 --syn-type: #d6c872;216 --syn-variable: #de7965;217 --syn-constant: #e5a873;218 --syn-string: #9fb970;142219}143220144221[data-theme="flexoki"] {@@ -147,6 +224,18 @@ html {147224 --borders: #282726;148225 --accent: #e8705f;149226 --accent-muted: #575653;227228 /* syntax */229 --syn-fg: #c6c2bb;230 --syn-punct: #a6a29d;231 --syn-comment: #8a847a;232 --syn-keyword: #af98ec;233 --syn-function: #69b1e0;234 --syn-builtin: #6dc6b5;235 --syn-type: #e3c363;236 --syn-variable: #e8705f;237 --syn-constant: #f0a26d;238 --syn-string: #a9b761;150239}151240152241/*============================*/@@ -276,19 +365,70 @@ pre {276365 border: 1px solid var(--borders);277366 border-radius: 6px;278367 overflow-x: auto;368 tab-size: 4;369 scrollbar-color: var(--borders) transparent;279370}280371281372pre code {282373 background: none;283374 padding: 0;284375 display: block;285 color: var(--text-body);286 font-size: 0.88rem;376 font-family:377 "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas,378 "Liberation Mono", monospace;379 color: var(--syn-fg);380 font-size: 0.84rem;381 font-synthesis: none;287382 border: none;288383 box-shadow: none;289384 line-height: 1.5;290385}291386387/* syntax roles, set by scripts/highlight.mjs */388.hl-comment {389 color: var(--syn-comment);390 font-style: italic;391}392393.hl-keyword {394 color: var(--syn-keyword);395}396397.hl-function,398.hl-link {399 color: var(--syn-function);400}401402.hl-builtin,403.hl-escape {404 color: var(--syn-builtin);405}406407.hl-type,408.hl-self,409.hl-changed {410 color: var(--syn-type);411}412413.hl-variable,414.hl-heading,415.hl-removed {416 color: var(--syn-variable);417}418419.hl-constant {420 color: var(--syn-constant);421}422423.hl-string,424.hl-added {425 color: var(--syn-string);426}427428.hl-punct {429 color: var(--syn-punct);430}431292432figure {293433 margin: 1.5rem 0;294434}@@ -531,7 +671,7 @@ nav p {531671 }532672533673 pre code {534 font-size: 0.82rem;674 font-size: 0.8rem;535675 }536676}537677@@ -1333,6 +1473,43 @@ a.rating:focus-visible {13331473 --rating-color: var(--rating-great);13341474}133514751476/*============================*/1477/* components - code block */1478/*============================*/14791480/* optional file label over a pre, like bat's header */1481.code-block {1482 margin: 2rem 0;1483}14841485.code-block pre {1486 margin: 0;1487 border-top-left-radius: 0;1488 border-top-right-radius: 0;1489}14901491.code-label {1492 margin: 0;1493 padding: 0.45rem 1.25rem;1494 border: 1px solid var(--borders);1495 border-bottom: 0;1496 border-radius: 6px 6px 0 0;1497 background: var(--background-dark);1498 font-size: 0.78rem;1499 color: var(--text-secondary);1500}15011502@media (max-width: 480px) {1503 .code-block {1504 margin: 1.5rem -0.5rem;1505 }15061507 .code-label {1508 padding-inline: 1rem;1509 border-radius: 4px 4px 0 0;1510 }1511}151213361513/*============================*/13371514/* components - images and layout helpers */13381515/*============================*/@@ -2369,6 +2546,18 @@ footer nav a,23692546 --rating-good: #ffffff;23702547 --rating-above-average: #d4f06a;23712548 --rating-great: #8dffab;25492550 /* flexoki 200, at least 6.8:1 on every surface */2551 --syn-fg: #ffffff;2552 --syn-punct: #e6e4d9;2553 --syn-comment: #cccccc;2554 --syn-keyword: #c4b9e0;2555 --syn-function: #92bfdb;2556 --syn-builtin: #87d3c3;2557 --syn-type: #eccb60;2558 --syn-variable: #f89a8a;2559 --syn-constant: #f9ae77;2560 --syn-string: #bec97e;23722561 }2373256223742563 a {@@ -2397,6 +2586,45 @@ footer nav a,23972586/*============================*/2398258723992588@media print {2589 html,2590 [data-theme] {2591 --text-body: #100f0f;2592 --text-headings: #100f0f;2593 --text-secondary: #575653;2594 --background-dark: #ffffff;2595 --surface: #f5f5f5;2596 --borders: #cccccc;2597 --accent: #100f0f;25982599 --rating-terrible: #af3029;2600 --rating-below-average: #bc5215;2601 --rating-good: #8e6b01;2602 --rating-above-average: #536907;2603 --rating-great: #1c6c66;26042605 /* flexoki 600/700, all at least 4.5:1 on #f5f5f5 */2606 --syn-fg: #100f0f;2607 --syn-punct: #575653;2608 --syn-comment: #6f6e69;2609 --syn-keyword: #5e409d;2610 --syn-function: #205ea6;2611 --syn-builtin: #1c6c66;2612 --syn-type: #8e6b01;2613 --syn-variable: #af3029;2614 --syn-constant: #9d4310;2615 --syn-string: #536907;2616 }26172618 pre {2619 white-space: pre-wrap;2620 overflow-wrap: anywhere;2621 break-inside: avoid;2622 }26232624 .code-label {2625 break-after: avoid;2626 }262724002628 body {24012629 background: white;24022630 color: black;@@ -2454,12 +2682,6 @@ footer nav a,24542682 display: none;24552683 }245626842457 pre,2458 code {2459 background: #f5f5f5;2460 border: 1px solid #ccc;2461 }246224632685 blockquote {24642686 border-left-color: black;24652687 }
index.html
+3 −3
@@ -5,7 +5,7 @@55 <meta name="viewport" content="width=device-width, initial-scale=1.0" />66 <meta77 name="description"8 content="daniel daum - software engineer based in oakland, ca"8 content="Software engineer based in Oakland, CA"99 />1010 <meta1111 http-equiv="Content-Security-Policy"@@ -53,7 +53,7 @@5353 <meta property="og:title" content="daniel daum" />5454 <meta5555 property="og:description"56 content="daniel daum - software engineer based in oakland, ca"56 content="Software engineer based in Oakland, CA"5757 />5858 <meta property="og:url" content="https://danieldaum.net/" />5959 <meta@@ -72,7 +72,7 @@7272 <meta name="twitter:title" content="daniel daum" />7373 <meta7474 name="twitter:description"75 content="daniel daum - software engineer based in oakland, ca"75 content="Software engineer based in Oakland, CA"7676 />7777 <meta7878 name="twitter:image"
internal/styles.html
+93 −4
@@ -155,6 +155,9 @@155155 <code>blockquote</code> and <code>figcaption</code> get the underline. A link156156 with a class styles itself.</li>157157 <li>Internal links end in a slash: <code>/now/sep-2026/</code>.</li>158 <li>Code blocks are <code><pre><code class="language-go"></code> with escaped source.159 Run <code>mise run highlight path/index.html</code> after writing or editing one; never160 hand-edit the spans.</li>158161 <li>Public pages allow no inline styles (<code>style-src 'self'</code>). Only internal/ pages,159162 like this one, use them.</li>160163 <li>The only script on the site is theme.js: it picks a palette per visit (moss, ink, wine,@@ -256,6 +259,71 @@256259 <p class="swatch-value" data-token="--rating-great"></p>257260 </div>258261 </div>262263 <h3>syntax</h3>264 <p>Code block colours, one set per palette. Same roles as the Zed, Helix and Warp themes.</p>265 <div class="swatch-row">266 <div class="swatch">267 <div class="swatch-block" style="background: var(--syn-fg);"></div>268 <p class="swatch-name">--syn-fg</p>269 <p class="swatch-value" data-token="--syn-fg"></p>270 <p class="swatch-value">plain code</p>271 </div>272 <div class="swatch">273 <div class="swatch-block" style="background: var(--syn-punct);"></div>274 <p class="swatch-name">--syn-punct</p>275 <p class="swatch-value" data-token="--syn-punct"></p>276 <p class="swatch-value">operators, brackets</p>277 </div>278 <div class="swatch">279 <div class="swatch-block" style="background: var(--syn-comment);"></div>280 <p class="swatch-name">--syn-comment</p>281 <p class="swatch-value" data-token="--syn-comment"></p>282 <p class="swatch-value">comments, italic</p>283 </div>284 <div class="swatch">285 <div class="swatch-block" style="background: var(--syn-keyword);"></div>286 <p class="swatch-name">--syn-keyword</p>287 <p class="swatch-value" data-token="--syn-keyword"></p>288 <p class="swatch-value">keywords</p>289 </div>290 <div class="swatch">291 <div class="swatch-block" style="background: var(--syn-function);"></div>292 <p class="swatch-name">--syn-function</p>293 <p class="swatch-value" data-token="--syn-function"></p>294 <p class="swatch-value">functions, links</p>295 </div>296 <div class="swatch">297 <div class="swatch-block" style="background: var(--syn-builtin);"></div>298 <p class="swatch-name">--syn-builtin</p>299 <p class="swatch-value" data-token="--syn-builtin"></p>300 <p class="swatch-value">builtins, escapes</p>301 </div>302 <div class="swatch">303 <div class="swatch-block" style="background: var(--syn-type);"></div>304 <p class="swatch-name">--syn-type</p>305 <p class="swatch-value" data-token="--syn-type"></p>306 <p class="swatch-value">types, self</p>307 </div>308 <div class="swatch">309 <div class="swatch-block" style="background: var(--syn-variable);"></div>310 <p class="swatch-name">--syn-variable</p>311 <p class="swatch-value" data-token="--syn-variable"></p>312 <p class="swatch-value">variables, tags</p>313 </div>314 <div class="swatch">315 <div class="swatch-block" style="background: var(--syn-constant);"></div>316 <p class="swatch-name">--syn-constant</p>317 <p class="swatch-value" data-token="--syn-constant"></p>318 <p class="swatch-value">numbers, constants</p>319 </div>320 <div class="swatch">321 <div class="swatch-block" style="background: var(--syn-string);"></div>322 <p class="swatch-name">--syn-string</p>323 <p class="swatch-value" data-token="--syn-string"></p>324 <p class="swatch-value">strings</p>325 </div>326 </div>259327 </section>260328261329 <!-- ===================== -->@@ -345,10 +413,31 @@345413 </div>346414347415 <div class="demo">348 <p class="demo-label">pre, code</p>349 <pre><code>function greet(name) {350 return `hello, ${name}`;351}</code></pre>416 <p class="demo-label">.code-block, pre, code</p>417 <figure class="code-block">418 <figcaption class="code-label">cmd/server/main.go</figcaption>419 <pre><code class="language-go"><span class="hl-keyword">package</span> <span class="hl-type">main</span>420421<span class="hl-keyword">import</span> <span class="hl-string">"fmt"</span>422423<span class="hl-comment">// server holds the listen config.</span>424<span class="hl-keyword">type</span> <span class="hl-type">server</span> <span class="hl-keyword">struct</span> <span class="hl-punct">{</span>425 <span class="hl-variable">addr</span> <span class="hl-type">string</span>426 <span class="hl-variable">timeout</span> <span class="hl-type">int</span>427 <span class="hl-variable">debug</span> <span class="hl-type">bool</span>428<span class="hl-punct">}</span>429430<span class="hl-keyword">func</span> <span class="hl-function">main</span><span class="hl-punct">()</span> <span class="hl-punct">{</span>431 <span class="hl-variable">s</span> <span class="hl-punct">:=</span> <span class="hl-type">server</span><span class="hl-punct">{</span><span class="hl-variable">addr</span><span class="hl-punct">:</span> <span class="hl-string">":8080"</span><span class="hl-punct">,</span> <span class="hl-variable">timeout</span><span class="hl-punct">:</span> <span class="hl-constant">30</span><span class="hl-punct">}</span>432 <span class="hl-variable">routes</span> <span class="hl-punct">:=</span> <span class="hl-punct">[]</span><span class="hl-type">string</span><span class="hl-punct">{</span><span class="hl-string">"/"</span><span class="hl-punct">,</span> <span class="hl-string">"/blog/"</span><span class="hl-punct">,</span> <span class="hl-string">"/now/"</span><span class="hl-punct">}</span>433 <span class="hl-variable">fmt</span><span class="hl-punct">.</span><span class="hl-function">Printf</span><span class="hl-punct">(</span><span class="hl-string">"listening on </span><span class="hl-escape">%s\n</span><span class="hl-string">"</span><span class="hl-punct">,</span> <span class="hl-variable">s</span><span class="hl-punct">.</span><span class="hl-variable">addr</span><span class="hl-punct">)</span>434 <span class="hl-variable">fmt</span><span class="hl-punct">.</span><span class="hl-function">Println</span><span class="hl-punct">(</span><span class="hl-builtin">len</span><span class="hl-punct">(</span><span class="hl-variable">routes</span><span class="hl-punct">),</span> <span class="hl-string">"routes"</span><span class="hl-punct">)</span>435<span class="hl-punct">}</span></code></pre>436 </figure>437 <pre><code class="language-bash"><span class="hl-comment"># highlight every post in place</span>438<span class="hl-keyword">for</span> <span class="hl-variable">page</span> <span class="hl-keyword">in</span> <span class="hl-string">blog/*/index.html</span><span class="hl-punct">;</span> <span class="hl-keyword">do</span>439 <span class="hl-function">mise</span> <span class="hl-string">run</span> <span class="hl-string">highlight</span> <span class="hl-string">"</span><span class="hl-variable">$page</span><span class="hl-string">"</span>440<span class="hl-keyword">done</span></code></pre>352441 </div>353442354443 <div class="demo">
mise.toml
+5 −0
@@ -22,3 +22,8 @@ run = [2222description = "Deploy the comment email worker"2323dir = "social"2424run = ["npm ci", "wrangler deploy -c email.toml"]2526# mise run highlight blog/some-post/index.html27[tasks.highlight]28description = "Syntax-highlight code blocks in place"29run = ["npm ci --prefix scripts --silent", "node scripts/highlight.mjs"]
ratings/index.html
+2 −2
@@ -234,7 +234,7 @@234234 A rating is one element with two classes. The modifier sets235235 the color, and the link goes back to this page.236236 </p>237 <pre><code><a class="rating rating--great" href="/ratings/">(5/5)</a></code></pre>237 <pre><code class="language-html"><span class="hl-punct"><</span><span class="hl-variable">a</span> <span class="hl-variable">class</span><span class="hl-punct">=</span><span class="hl-string">"rating rating--great"</span> <span class="hl-variable">href</span><span class="hl-punct">=</span><span class="hl-string">"/ratings/"</span><span class="hl-punct">></span>(5/5)<span class="hl-punct"></</span><span class="hl-variable">a</span><span class="hl-punct">></span></code></pre>238238 <p class="meta">239239 Modifiers, 1 to 5: <code>rating--terrible</code>,240240 <code>rating--below-average</code>,@@ -248,7 +248,7 @@248248 rating there is a span instead of a second link. It looks249249 the same.250250 </p>251 <pre><code><span class="rating rating--great">(5/5)</span></code></pre>251 <pre><code class="language-html"><span class="hl-punct"><</span><span class="hl-variable">span</span> <span class="hl-variable">class</span><span class="hl-punct">=</span><span class="hl-string">"rating rating--great"</span><span class="hl-punct">></span>(5/5)<span class="hl-punct"></</span><span class="hl-variable">span</span><span class="hl-punct">></span></code></pre>252252 </section>253253 </main>254254
scripts/highlight.mjsadded
+136 −0
@@ -0,0 +1,136 @@1// Build-time syntax highlighting for code blocks. No runtime JS and no inline styles, so the2// CSP holds. Colors live in global.css (--syn-* per theme), the same roles as the Zed, Helix3// and Warp themes.4//5// mise run highlight blog/some-post/index.html highlight every6// <pre><code class="language-X"> block in the file(s), in place7// node scripts/highlight.mjs go < snippet.go print highlighted HTML for a snippet8//9// Shiki lives in scripts/node_modules (npm ci --prefix scripts); scripts/ is never deployed.10//11// Blocks that already contain hl- spans, or any other tag, are left alone, so it is safe to12// run again. "text" and "plaintext" blocks are skipped.13//14// How it works: a TextMate theme whose colors are role markers (#000001, #000002, ...).15// Shiki tokenizes with VS Code's grammars; each token's marker becomes a class.16import { createHighlighter } from "shiki";17import { readFileSync, writeFileSync } from "node:fs";1819// role -> TextMate scopes (the most specific selector wins, as in any TextMate theme)20const ROLES = {21 comment: ["comment", "punctuation.definition.comment"],22 variable: [23 "variable", "variable.other", "variable.parameter", "variable.other.property",24 "variable.other.object.property", "variable.other.member", "meta.object-literal.key",25 "support.type.property-name", "entity.other.attribute-name", "entity.name.tag",26 "punctuation.definition.variable", "meta.definition.variable",27 ],28 self: ["variable.language"],29 string: ["string", "string punctuation.definition.string", "markup.raw", "markup.inline.raw"],30 escape: ["constant.character.escape", "string.regexp", "constant.other.placeholder"],31 constant: [32 "constant.numeric", "constant.language", "constant.other", "support.constant",33 "variable.other.constant", "variable.parameter.option", "entity.name.function.decorator",34 "meta.decorator", "meta.annotation",35 ],36 keyword: [37 "keyword", "storage.type", "storage.modifier", "keyword.control", "keyword.declaration",38 "punctuation.definition.template-expression", "punctuation.section.embedded",39 ],40 type: [41 "entity.name.type", "entity.name.class", "support.type", "support.class",42 "entity.other.inherited-class", "source.go storage.type", "source.go entity.name.type",43 ],44 function: [45 "entity.name.function", "support.function", "meta.function-call entity.name.function",46 "variable.function", "meta.function-call.generic",47 ],48 builtin: ["support.function.builtin", "entity.name.function.support.builtin"],49 punct: ["keyword.operator", "punctuation", "meta.brace", "punctuation.separator"],50 heading: ["markup.heading", "entity.name.section"],51 added: ["markup.inserted"],52 removed: ["markup.deleted"],53 changed: ["markup.changed"],54 link: ["markup.underline.link", "string.other.link"],55};56// word operators (and, in, typeof, new) stay keywords; shell builtins read as commands57const OVERRIDES = [58 ["keyword", ["keyword.operator.word", "keyword.operator.expression", "keyword.operator.new"]],59 ["function", ["source.shell support.function"]],60];6162const names = Object.keys(ROLES);63const marker = (i) => "#0000" + (i + 1).toString(16).padStart(2, "0");64const theme = {65 name: "roles",66 type: "dark",67 colors: { "editor.foreground": "#000000", "editor.background": "#ffffff" },68 tokenColors: [69 { settings: { foreground: "#000000" } },70 ...names.map((n, i) => ({ scope: ROLES[n], settings: { foreground: marker(i) } })),71 ...OVERRIDES.map(([n, scope]) => ({ scope, settings: { foreground: marker(names.indexOf(n)) } })),72 ],73};74const roleOf = Object.fromEntries(names.map((n, i) => [marker(i).toUpperCase(), n]));7576const escape = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");77const unescape = (s) =>78 s79 .replace(/&#x([0-9a-f]+);/gi, (_, h) => String.fromCodePoint(parseInt(h, 16)))80 .replace(/&#(\d+);/g, (_, d) => String.fromCodePoint(Number(d)))81 .replace(/"/g, '"').replace(/'/g, "'")82 .replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");8384const PLAIN = new Set(["text", "plaintext", "txt", "plain"]);85let highlighter;86async function load(langs) {87 highlighter ??= await createHighlighter({ themes: [theme], langs: [] });88 for (const lang of langs) {89 if (!highlighter.getLoadedLanguages().includes(lang)) await highlighter.loadLanguage(lang);90 }91 return highlighter;92}9394export async function highlight(code, lang) {95 const hl = await load([lang]);96 return hl97 .codeToTokensBase(code.replace(/\n$/, ""), { lang, theme: "roles" })98 .map((line) =>99 line100 .map((t) => {101 const role = roleOf[(t.color || "").toUpperCase()];102 return role ? `<span class="hl-${role}">${escape(t.content)}</span>` : escape(t.content);103 })104 .join(""),105 )106 .join("\n");107}108109const BLOCK = /(<pre[^>]*>\s*<code\b[^>]*\bclass="[^"]*\blanguage-([\w+#-]+)[^"]*"[^>]*>)([\s\S]*?)(<\/code>\s*<\/pre>)/g;110111export async function highlightFile(path) {112 const html = readFileSync(path, "utf8");113 const jobs = [];114 for (const m of html.matchAll(BLOCK)) {115 const [whole, open, lang, body, close] = m;116 if (PLAIN.has(lang) || /</.test(body)) continue; // plain, already highlighted, or hand-marked117 jobs.push({ whole, html: open + (await highlight(unescape(body), lang)) + close });118 }119 let out = html;120 for (const j of jobs) out = out.replace(j.whole, () => j.html);121 if (out !== html) writeFileSync(path, out);122 console.error(`${path}: ${jobs.length} block(s) highlighted`);123}124125if (import.meta.url === `file://${process.argv[1]}`) {126 const args = process.argv.slice(2);127 if (!args.length) {128 console.error("usage: node scripts/highlight.mjs <lang> < file\n node scripts/highlight.mjs page.html [...]");129 process.exit(1);130 }131 if (args.every((a) => a.endsWith(".html"))) {132 for (const f of args) await highlightFile(f);133 } else {134 process.stdout.write((await highlight(readFileSync(0, "utf8"), args[0])) + "\n");135 }136}
scripts/package-lock.jsonadded
+571 −0
@@ -0,0 +1,571 @@1{2 "name": "saturn-scripts",3 "lockfileVersion": 3,4 "requires": true,5 "packages": {6 "": {7 "name": "saturn-scripts",8 "dependencies": {9 "shiki": "4.5.0"10 }11 },12 "node_modules/@shikijs/core": {13 "version": "4.5.0",14 "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-4.5.0.tgz",15 "integrity": "sha512-6CIgwq+bt2JZ3OSjb/nBkkwEf/CfpHcbam+Mg5Pllco7HAGRQ2/EFhZrrJtbyNTgKwknfVS+llsXGygiDGwJWw==",16 "license": "MIT",17 "dependencies": {18 "@shikijs/primitive": "4.5.0",19 "@shikijs/types": "4.5.0",20 "@shikijs/vscode-textmate": "^10.0.2",21 "@types/hast": "^3.0.5",22 "hast-util-to-html": "^9.0.5"23 },24 "engines": {25 "node": ">=20"26 }27 },28 "node_modules/@shikijs/engine-javascript": {29 "version": "4.5.0",30 "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-4.5.0.tgz",31 "integrity": "sha512-Ed6UdEj84LyYkwnxM5CvSMWAD+id9ExTYri0/+x41U9zrgNifPSS9lZm0JqBP0VfYI8yr8tY5nbNq9+p9R0kFA==",32 "license": "MIT",33 "dependencies": {34 "@shikijs/types": "4.5.0",35 "@shikijs/vscode-textmate": "^10.0.2",36 "oniguruma-to-es": "^4.3.6"37 },38 "engines": {39 "node": ">=20"40 }41 },42 "node_modules/@shikijs/engine-oniguruma": {43 "version": "4.5.0",44 "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-4.5.0.tgz",45 "integrity": "sha512-dKVmbJecVdB9recl8a/CU4jdpNXyjJQrIcesIkpS70s5HS02ohpnCSpMUbotPnEUzbAcLQ+S4hwZYbkBBiTcJw==",46 "license": "MIT",47 "dependencies": {48 "@shikijs/types": "4.5.0",49 "@shikijs/vscode-textmate": "^10.0.2"50 },51 "engines": {52 "node": ">=20"53 }54 },55 "node_modules/@shikijs/langs": {56 "version": "4.5.0",57 "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-4.5.0.tgz",58 "integrity": "sha512-wwBTqwduXSz0X4v9Qa2EWeFaYJEw1clCncWjoRNQRbVDu3SPRTRWucnouYapKj3b8Q+sk/41Vbc4B5c8nuYzLA==",59 "license": "MIT",60 "dependencies": {61 "@shikijs/types": "4.5.0"62 },63 "engines": {64 "node": ">=20"65 }66 },67 "node_modules/@shikijs/primitive": {68 "version": "4.5.0",69 "resolved": "https://registry.npmjs.org/@shikijs/primitive/-/primitive-4.5.0.tgz",70 "integrity": "sha512-UM7ShlA8oz0OWxLLO8BmO9Ip6fVqdkt8yF0EH7nOCqHfrx1eEAzF0ZUVK7L+I8NEgeu1PEWSRlxaiPPeCb4iDg==",71 "license": "MIT",72 "dependencies": {73 "@shikijs/types": "4.5.0",74 "@shikijs/vscode-textmate": "^10.0.2",75 "@types/hast": "^3.0.5"76 },77 "engines": {78 "node": ">=20"79 }80 },81 "node_modules/@shikijs/themes": {82 "version": "4.5.0",83 "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-4.5.0.tgz",84 "integrity": "sha512-zGb87H3UBbpuI4yoh5UguB1XbU+2BDU3kflM7UfZ+Cy2hWo9lBtqjSVK20gmLY6ukYl040hAypGXMgud9vul8Q==",85 "license": "MIT",86 "dependencies": {87 "@shikijs/types": "4.5.0"88 },89 "engines": {90 "node": ">=20"91 }92 },93 "node_modules/@shikijs/types": {94 "version": "4.5.0",95 "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.5.0.tgz",96 "integrity": "sha512-drtPrtD8N0DENyD2cyt6Ajy+IWsiCLgMxODwLTpvH1UsN6a9jf90tNTPjqwHvA+0Lzu9e0txk8DjfqH1p9UJRw==",97 "license": "MIT",98 "dependencies": {99 "@shikijs/vscode-textmate": "^10.0.2",100 "@types/hast": "^3.0.5"101 },102 "engines": {103 "node": ">=20"104 }105 },106 "node_modules/@shikijs/vscode-textmate": {107 "version": "10.1.0",108 "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.1.0.tgz",109 "integrity": "sha512-cVBuhDQjBZaNMTwBquYfPydrUP+E3hE6oYGasx8h6ZrODIM7/r+gxLDXdd66oszbrggZHEntdE6j+5gYIVyMWQ==",110 "license": "MIT"111 },112 "node_modules/@types/hast": {113 "version": "3.0.5",114 "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.5.tgz",115 "integrity": "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==",116 "license": "MIT",117 "dependencies": {118 "@types/unist": "*"119 }120 },121 "node_modules/@types/mdast": {122 "version": "4.0.4",123 "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz",124 "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==",125 "license": "MIT",126 "dependencies": {127 "@types/unist": "*"128 }129 },130 "node_modules/@types/unist": {131 "version": "3.0.3",132 "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",133 "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==",134 "license": "MIT"135 },136 "node_modules/@ungap/structured-clone": {137 "version": "1.4.0",138 "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.4.0.tgz",139 "integrity": "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==",140 "license": "ISC"141 },142 "node_modules/ccount": {143 "version": "2.0.1",144 "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz",145 "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==",146 "license": "MIT",147 "funding": {148 "type": "github",149 "url": "https://github.com/sponsors/wooorm"150 }151 },152 "node_modules/character-entities-html4": {153 "version": "2.1.0",154 "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz",155 "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==",156 "license": "MIT",157 "funding": {158 "type": "github",159 "url": "https://github.com/sponsors/wooorm"160 }161 },162 "node_modules/character-entities-legacy": {163 "version": "3.0.0",164 "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz",165 "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==",166 "license": "MIT",167 "funding": {168 "type": "github",169 "url": "https://github.com/sponsors/wooorm"170 }171 },172 "node_modules/comma-separated-tokens": {173 "version": "2.0.3",174 "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz",175 "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==",176 "license": "MIT",177 "funding": {178 "type": "github",179 "url": "https://github.com/sponsors/wooorm"180 }181 },182 "node_modules/dequal": {183 "version": "2.0.3",184 "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",185 "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",186 "license": "MIT",187 "engines": {188 "node": ">=6"189 }190 },191 "node_modules/devlop": {192 "version": "1.1.0",193 "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz",194 "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==",195 "license": "MIT",196 "dependencies": {197 "dequal": "^2.0.0"198 },199 "funding": {200 "type": "github",201 "url": "https://github.com/sponsors/wooorm"202 }203 },204 "node_modules/hast-util-to-html": {205 "version": "9.0.5",206 "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.5.tgz",207 "integrity": "sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==",208 "license": "MIT",209 "dependencies": {210 "@types/hast": "^3.0.0",211 "@types/unist": "^3.0.0",212 "ccount": "^2.0.0",213 "comma-separated-tokens": "^2.0.0",214 "hast-util-whitespace": "^3.0.0",215 "html-void-elements": "^3.0.0",216 "mdast-util-to-hast": "^13.0.0",217 "property-information": "^7.0.0",218 "space-separated-tokens": "^2.0.0",219 "stringify-entities": "^4.0.0",220 "zwitch": "^2.0.4"221 },222 "funding": {223 "type": "opencollective",224 "url": "https://opencollective.com/unified"225 }226 },227 "node_modules/hast-util-whitespace": {228 "version": "3.0.0",229 "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz",230 "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==",231 "license": "MIT",232 "dependencies": {233 "@types/hast": "^3.0.0"234 },235 "funding": {236 "type": "opencollective",237 "url": "https://opencollective.com/unified"238 }239 },240 "node_modules/html-void-elements": {241 "version": "3.0.0",242 "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz",243 "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==",244 "license": "MIT",245 "funding": {246 "type": "github",247 "url": "https://github.com/sponsors/wooorm"248 }249 },250 "node_modules/mdast-util-to-hast": {251 "version": "13.2.1",252 "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz",253 "integrity": "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==",254 "license": "MIT",255 "dependencies": {256 "@types/hast": "^3.0.0",257 "@types/mdast": "^4.0.0",258 "@ungap/structured-clone": "^1.0.0",259 "devlop": "^1.0.0",260 "micromark-util-sanitize-uri": "^2.0.0",261 "trim-lines": "^3.0.0",262 "unist-util-position": "^5.0.0",263 "unist-util-visit": "^5.0.0",264 "vfile": "^6.0.0"265 },266 "funding": {267 "type": "opencollective",268 "url": "https://opencollective.com/unified"269 }270 },271 "node_modules/micromark-util-character": {272 "version": "2.1.1",273 "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz",274 "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==",275 "funding": [276 {277 "type": "GitHub Sponsors",278 "url": "https://github.com/sponsors/unifiedjs"279 },280 {281 "type": "OpenCollective",282 "url": "https://opencollective.com/unified"283 }284 ],285 "license": "MIT",286 "dependencies": {287 "micromark-util-symbol": "^2.0.0",288 "micromark-util-types": "^2.0.0"289 }290 },291 "node_modules/micromark-util-encode": {292 "version": "2.0.1",293 "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz",294 "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==",295 "funding": [296 {297 "type": "GitHub Sponsors",298 "url": "https://github.com/sponsors/unifiedjs"299 },300 {301 "type": "OpenCollective",302 "url": "https://opencollective.com/unified"303 }304 ],305 "license": "MIT"306 },307 "node_modules/micromark-util-sanitize-uri": {308 "version": "2.0.1",309 "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz",310 "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==",311 "funding": [312 {313 "type": "GitHub Sponsors",314 "url": "https://github.com/sponsors/unifiedjs"315 },316 {317 "type": "OpenCollective",318 "url": "https://opencollective.com/unified"319 }320 ],321 "license": "MIT",322 "dependencies": {323 "micromark-util-character": "^2.0.0",324 "micromark-util-encode": "^2.0.0",325 "micromark-util-symbol": "^2.0.0"326 }327 },328 "node_modules/micromark-util-symbol": {329 "version": "2.0.1",330 "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz",331 "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==",332 "funding": [333 {334 "type": "GitHub Sponsors",335 "url": "https://github.com/sponsors/unifiedjs"336 },337 {338 "type": "OpenCollective",339 "url": "https://opencollective.com/unified"340 }341 ],342 "license": "MIT"343 },344 "node_modules/micromark-util-types": {345 "version": "2.0.3",346 "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.3.tgz",347 "integrity": "sha512-oxB2Ik03hI0gv+VNn9tnh1t1YEe9MDPptViAEgfdf3YQHsn0pzGTgCdlSCJXcwhqm8phaEuM7zeEu3QQzVBrPg==",348 "funding": [349 {350 "type": "GitHub Sponsors",351 "url": "https://github.com/sponsors/unifiedjs"352 },353 {354 "type": "OpenCollective",355 "url": "https://opencollective.com/unified"356 }357 ],358 "license": "MIT"359 },360 "node_modules/oniguruma-parser": {361 "version": "0.12.2",362 "resolved": "https://registry.npmjs.org/oniguruma-parser/-/oniguruma-parser-0.12.2.tgz",363 "integrity": "sha512-6HVa5oIrgMC6aA6WF6XyyqbhRPJrKR02L20+2+zpDtO5QAzGHAUGw5TKQvwi5vctNnRHkJYmjAhRVQF2EKdTQw==",364 "license": "MIT"365 },366 "node_modules/oniguruma-to-es": {367 "version": "4.3.6",368 "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-4.3.6.tgz",369 "integrity": "sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA==",370 "license": "MIT",371 "dependencies": {372 "oniguruma-parser": "^0.12.2",373 "regex": "^6.1.0",374 "regex-recursion": "^6.0.2"375 }376 },377 "node_modules/property-information": {378 "version": "7.2.0",379 "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.2.0.tgz",380 "integrity": "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg==",381 "license": "MIT",382 "funding": {383 "type": "github",384 "url": "https://github.com/sponsors/wooorm"385 }386 },387 "node_modules/regex": {388 "version": "6.1.0",389 "resolved": "https://registry.npmjs.org/regex/-/regex-6.1.0.tgz",390 "integrity": "sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg==",391 "license": "MIT",392 "dependencies": {393 "regex-utilities": "^2.3.0"394 }395 },396 "node_modules/regex-recursion": {397 "version": "6.0.2",398 "resolved": "https://registry.npmjs.org/regex-recursion/-/regex-recursion-6.0.2.tgz",399 "integrity": "sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==",400 "license": "MIT",401 "dependencies": {402 "regex-utilities": "^2.3.0"403 }404 },405 "node_modules/regex-utilities": {406 "version": "2.3.0",407 "resolved": "https://registry.npmjs.org/regex-utilities/-/regex-utilities-2.3.0.tgz",408 "integrity": "sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==",409 "license": "MIT"410 },411 "node_modules/shiki": {412 "version": "4.5.0",413 "resolved": "https://registry.npmjs.org/shiki/-/shiki-4.5.0.tgz",414 "integrity": "sha512-OcRW72ngQvc+MSVWBRIovC/BTW589iUE/Vxav7VeM4RcY9MUjqB+IR6ILG1k9nuW6LiG/nct9uma4/MBtnZbmQ==",415 "license": "MIT",416 "dependencies": {417 "@shikijs/core": "4.5.0",418 "@shikijs/engine-javascript": "4.5.0",419 "@shikijs/engine-oniguruma": "4.5.0",420 "@shikijs/langs": "4.5.0",421 "@shikijs/themes": "4.5.0",422 "@shikijs/types": "4.5.0",423 "@shikijs/vscode-textmate": "^10.0.2",424 "@types/hast": "^3.0.5"425 },426 "engines": {427 "node": ">=20"428 }429 },430 "node_modules/space-separated-tokens": {431 "version": "2.0.2",432 "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz",433 "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==",434 "license": "MIT",435 "funding": {436 "type": "github",437 "url": "https://github.com/sponsors/wooorm"438 }439 },440 "node_modules/stringify-entities": {441 "version": "4.0.4",442 "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz",443 "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==",444 "license": "MIT",445 "dependencies": {446 "character-entities-html4": "^2.0.0",447 "character-entities-legacy": "^3.0.0"448 },449 "funding": {450 "type": "github",451 "url": "https://github.com/sponsors/wooorm"452 }453 },454 "node_modules/trim-lines": {455 "version": "3.0.1",456 "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz",457 "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==",458 "license": "MIT",459 "funding": {460 "type": "github",461 "url": "https://github.com/sponsors/wooorm"462 }463 },464 "node_modules/unist-util-is": {465 "version": "6.0.1",466 "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz",467 "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==",468 "license": "MIT",469 "dependencies": {470 "@types/unist": "^3.0.0"471 },472 "funding": {473 "type": "opencollective",474 "url": "https://opencollective.com/unified"475 }476 },477 "node_modules/unist-util-position": {478 "version": "5.0.0",479 "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz",480 "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==",481 "license": "MIT",482 "dependencies": {483 "@types/unist": "^3.0.0"484 },485 "funding": {486 "type": "opencollective",487 "url": "https://opencollective.com/unified"488 }489 },490 "node_modules/unist-util-stringify-position": {491 "version": "4.0.0",492 "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz",493 "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==",494 "license": "MIT",495 "dependencies": {496 "@types/unist": "^3.0.0"497 },498 "funding": {499 "type": "opencollective",500 "url": "https://opencollective.com/unified"501 }502 },503 "node_modules/unist-util-visit": {504 "version": "5.1.0",505 "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz",506 "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==",507 "license": "MIT",508 "dependencies": {509 "@types/unist": "^3.0.0",510 "unist-util-is": "^6.0.0",511 "unist-util-visit-parents": "^6.0.0"512 },513 "funding": {514 "type": "opencollective",515 "url": "https://opencollective.com/unified"516 }517 },518 "node_modules/unist-util-visit-parents": {519 "version": "6.0.2",520 "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz",521 "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==",522 "license": "MIT",523 "dependencies": {524 "@types/unist": "^3.0.0",525 "unist-util-is": "^6.0.0"526 },527 "funding": {528 "type": "opencollective",529 "url": "https://opencollective.com/unified"530 }531 },532 "node_modules/vfile": {533 "version": "6.0.3",534 "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz",535 "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==",536 "license": "MIT",537 "dependencies": {538 "@types/unist": "^3.0.0",539 "vfile-message": "^4.0.0"540 },541 "funding": {542 "type": "opencollective",543 "url": "https://opencollective.com/unified"544 }545 },546 "node_modules/vfile-message": {547 "version": "4.0.3",548 "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz",549 "integrity": "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==",550 "license": "MIT",551 "dependencies": {552 "@types/unist": "^3.0.0",553 "unist-util-stringify-position": "^4.0.0"554 },555 "funding": {556 "type": "opencollective",557 "url": "https://opencollective.com/unified"558 }559 },560 "node_modules/zwitch": {561 "version": "2.0.4",562 "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz",563 "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==",564 "license": "MIT",565 "funding": {566 "type": "github",567 "url": "https://github.com/sponsors/wooorm"568 }569 }570 }571}
scripts/package.jsonadded
+8 −0
@@ -0,0 +1,8 @@1{2 "name": "saturn-scripts",3 "private": true,4 "type": "module",5 "dependencies": {6 "shiki": "4.5.0"7 }8}