From 5f0f14d12b393934c7d8a54b7ec9e92525785a11 Mon Sep 17 00:00:00 2001
From: Stephen Waits
Date: Wed, 8 Apr 2026 17:06:27 -0600
Subject: [PATCH] feat: syntax highlighting with theme-matched colors,
highlight toggle, layout tweaks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Custom Shiki theme matching site palette (green keywords, yellow strings,
blue functions, purple constants). Toggle button to switch between
highlighted and plain green. Reorganized page: What is it → Quick Start →
What can you do. Tightened copy. Narrower architecture diagram.
---
src/pages/index.astro | 89 +++++++++++++++++++++++++++++++++++--------
src/styles/global.css | 7 ++++
2 files changed, 80 insertions(+), 16 deletions(-)
diff --git a/src/pages/index.astro b/src/pages/index.astro
index 8b0a581..c7245a0 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -1,5 +1,43 @@
---
import Base from "../layouts/Base.astro";
+import { Code } from "astro:components";
+
+const quickStartCode = `import donglora as dl
+
+ser = dl.connect()
+dl.send(ser, "SetConfig", config=dl.DEFAULT_CONFIG)
+dl.send(ser, "StartRx")
+
+while pkt := dl.recv(ser):
+ print(f'{pkt["rssi"]:4d}dBm {pkt["snr"]:3d}dB {pkt["payload"].hex()}')`;
+
+// Shiki theme tuned to match the site's green-accent dark palette
+const siteTheme = {
+ name: "donglora",
+ type: "dark" as const,
+ colors: {
+ "editor.background": "#12121a",
+ "editor.foreground": "#e0e0e8",
+ },
+ settings: [
+ { scope: ["comment"], settings: { foreground: "#555570", fontStyle: "italic" } },
+ { scope: ["keyword", "storage", "keyword.control"], settings: { foreground: "#6ee7b7" } },
+ { scope: ["string", "string.quoted"], settings: { foreground: "#fbbf24" } },
+ { scope: ["constant.numeric", "constant.language"], settings: { foreground: "#c4b5fd" } },
+ { scope: ["entity.name.function", "meta.function-call"], settings: { foreground: "#60a5fa" } },
+ { scope: ["support.function", "support.function.builtin"], settings: { foreground: "#60a5fa" } },
+ { scope: ["variable", "variable.other"], settings: { foreground: "#e0e0e8" } },
+ { scope: ["variable.parameter", "variable.other.readwrite"], settings: { foreground: "#e0e0e8" } },
+ { scope: ["keyword.operator", "keyword.operator.assignment", "keyword.operator.comparison"], settings: { foreground: "#6ee7b7" } },
+ { scope: ["punctuation", "meta.brace"], settings: { foreground: "#8888a0" } },
+ { scope: ["punctuation.definition.string", "punctuation.section"], settings: { foreground: "#fbbf24" } },
+ { scope: ["entity.name.import", "entity.name.module"], settings: { foreground: "#34d399" } },
+ { scope: ["support.type", "entity.name.type"], settings: { foreground: "#60a5fa" } },
+ { scope: ["constant.other", "variable.other.constant"], settings: { foreground: "#c4b5fd" } },
+ { scope: ["meta.function-call.arguments", "variable.parameter.function-call"], settings: { foreground: "#e0e0e8" } },
+ { scope: ["meta.attribute", "entity.other.attribute-name"], settings: { foreground: "#8888a0" } },
+ ],
+};
---
@@ -75,18 +113,37 @@ import Base from "../layouts/Base.astro";
3.
Listen for packets
-
+
+
+
+
+
+
{quickStartCode}
+
+
@@ -103,11 +160,11 @@ while pkt := dl.recv(ser):
your code ──► client library ──► USB ──► firmware ──► LoRa radio
+ >your code ──► client lib ──► USB ──► DongLoRa radio
-your code ──► client library ──┐
-your code ──► client library ──┼──► mux ──► USB ──► firmware ──► LoRa radio
-your code ──► client library ──┘
+your code ──► client lib ──┐
+your code ──► client lib ──┼──► mux ──► USB ──► DongLoRa radio
+your code ──► client lib ──┘
Because the firmware is protocol-agnostic, a DongLoRa dongle works with any LoRa network
— Meshtastic, MeshCore, custom protocols, or raw packets.
diff --git a/src/styles/global.css b/src/styles/global.css
index d82b092..56c49f6 100644
--- a/src/styles/global.css
+++ b/src/styles/global.css
@@ -48,4 +48,11 @@
background: var(--color-border-bright);
border-radius: 3px;
}
+
+ /* Shiki code blocks — match site card background */
+ .astro-code {
+ background-color: var(--color-bg-card) !important;
+ padding: 1rem;
+ font-size: 0.875rem;
+ }
}