Skip to content

Claude's answers, rendered: Markdown, math, charts and diagrams drawn in the Claude Code terminal. Independent project, not affiliated with Anthropic.

TypeScript claude-code-mod

Add the Claude Code theme as the default; rename marketing to outcomes

razorback16e5802c4b737c
diff --git a/README.md b/README.md
index 0ec7c0e..0e10480 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,8 @@
-# md-preview
+# Intelligent UI
-A Claude Code mod that draws Claude's answers as rendered Markdown pictures, with a look close to VS Code's Markdown preview. Claude can also put live Typst in an answer, for diagrams, charts and math.
+A Claude Code mod that draws Claude's answers as rendered Markdown pictures, in Claude Code's own colours or with a look close to VS Code's Markdown preview.
+
+The plugin is still installed as `md-preview`, and its command is still `/md-preview`. A later version changes them to `claude-intelligent-ui` and `/iui`. Claude can also put live Typst in an answer, for diagrams, charts and math.
Only the drawing changes. The saved answer stays Markdown.
@@ -104,11 +106,12 @@ The mod uses this flow only when it can draw the plan: the mod is on, Typst is i
## Themes
-A theme sets the colours, fonts and spacing of the picture. Two themes are in the mod:
+A theme sets the colours, fonts and spacing of the picture. Three themes are in the mod:
| Name | Looks like |
|---|---|
-| `vscode-modern` (default) | VS Code's Markdown preview with Dark Modern / Light Modern |
+| `claude-code` (default) | Claude Code's own Markdown colours, from its dark and light themes |
+| `vscode-modern` | VS Code's Markdown preview with Dark Modern / Light Modern |
| `vscode` | The same, with the Dark+ / Light+ colours |
Each theme has a dark and a light part. The mod uses the part that agrees with Claude Code's theme.
@@ -116,7 +119,7 @@ Each theme has a dark and a light part. The mod uses the part that agrees with C
### Make your own theme
1. Make a folder: `~/.claude/md-preview/themes/<name>/`.
-2. Put a `theme.json` in it. Write only the keys that you change. The mod merges your file over the base theme, `vscode` (not over the default, `vscode-modern`).
+2. Put a `theme.json` in it. Write only the keys that you change. The mod merges your file over the base theme, `vscode` (not over the default, `claude-code`).
3. Run `/md-preview theme <name>`. You do not have to restart.
Example: pink inline code with rounder boxes.
@@ -137,7 +140,7 @@ Example: pink inline code with rounder boxes.
All keys, their units and their defaults are in [`render/themes/README.md`](render/themes/README.md).
-The `vscode` and `vscode-modern` values come from VS Code (MIT licence, Copyright (c) 2015 - present Microsoft Corporation). The `LICENSE` file is in each of those folders.
+The `vscode` and `vscode-modern` values come from VS Code (MIT licence, Copyright (c) 2015 - present Microsoft Corporation). The `claude-code` theme uses the ANSI colours of the VS Code terminal for links and code. The `LICENSE` file is in each of those folders.
## How it works
@@ -151,20 +154,20 @@ The `vscode` and `vscode-modern` values come from VS Code (MIT licence, Copyrigh
### How `auto` is resolved
-Claude Code finds the light or dark mode for `auto` by asking the terminal for its background colour (OSC 11). A mod cannot see that answer, so md-preview uses these sources, in this order. The first source that gives an answer is used:
+Claude Code finds the light or dark mode for `auto` by asking the terminal for its background colour (OSC 11). A mod cannot see that answer, so Intelligent UI uses these sources, in this order. The first source that gives an answer is used:
-1. **The iTerm2 profile:** the background colour of the profile in use (`ITERM_PROFILE`, else the default profile). md-preview finds iTerm2 by `TERM_PROGRAM`. If `TERM_PROGRAM` is not set, `ITERM_PROFILE`, `ITERM_SESSION_ID` or `LC_TERMINAL=iTerm2` also show iTerm2. If the profile has separate colours for light and dark mode, md-preview uses the set for iTerm2's theme (Settings > Appearance). If that theme is Automatic, Minimal or Compact, it uses the set for the OS appearance.
-2. **The Ghostty config:** the `background` that `ghostty +show-config` gives. With a `theme = light:A,dark:B`, md-preview reads the background from the theme file for the OS appearance. With no theme and no `background`, it uses Ghostty's default (`#282c34`, dark).
- - **cmux** (Ghostty inside, found by its `CMUX_*` variables) reads the same Ghostty config. If that config sets no `theme`, `background`, `foreground` or `palette`, cmux uses its adaptive default theme. md-preview then uses cmux's appearance: `app.appearance` in `~/.config/cmux/cmux.json`, else the value in cmux's Settings. If that appearance is System, md-preview uses the OS appearance. If `terminal.adaptiveDefaultTheme` is `false` in `cmux.json`, md-preview uses the Ghostty rules above.
-3. **The kitty config:** the `background` in `kitty.conf` and in the files that it includes (`include` lines only). The themes kitten writes such an include. If the config folder has `dark-theme.auto.conf`, `light-theme.auto.conf` or `no-preference-theme.auto.conf` (kitty 0.38 and later), md-preview uses the file for the OS appearance, as kitty does. With no `background`, it uses kitty's default (`#000000`, dark). The config folder is `KITTY_CONFIG_DIRECTORY`. If that is not set, it is the first of `$XDG_CONFIG_HOME/kitty`, `~/.config/kitty` and (on macOS) `~/Library/Preferences/kitty` that has a `kitty.conf`.
-4. **The Rio config:** `config.toml` in `RIO_CONFIG_HOME`, else in `~/.config/rio` (on Linux, `$XDG_CONFIG_HOME/rio` if that is set). With an `[adaptive-theme]`, md-preview reads the theme file for `force-theme`, else for the OS appearance. Else it reads the file for `theme`, else the `[colors] background`. Theme files are in the `themes` folder. With no background, it uses Rio's default (`#0F0D0E`, dark).
+1. **The iTerm2 profile:** the background colour of the profile in use (`ITERM_PROFILE`, else the default profile). Intelligent UI finds iTerm2 by `TERM_PROGRAM`. If `TERM_PROGRAM` is not set, `ITERM_PROFILE`, `ITERM_SESSION_ID` or `LC_TERMINAL=iTerm2` also show iTerm2. If the profile has separate colours for light and dark mode, Intelligent UI uses the set for iTerm2's theme (Settings > Appearance). If that theme is Automatic, Minimal or Compact, it uses the set for the OS appearance.
+2. **The Ghostty config:** the `background` that `ghostty +show-config` gives. With a `theme = light:A,dark:B`, Intelligent UI reads the background from the theme file for the OS appearance. With no theme and no `background`, it uses Ghostty's default (`#282c34`, dark).
+ - **cmux** (Ghostty inside, found by its `CMUX_*` variables) reads the same Ghostty config. If that config sets no `theme`, `background`, `foreground` or `palette`, cmux uses its adaptive default theme. Intelligent UI then uses cmux's appearance: `app.appearance` in `~/.config/cmux/cmux.json`, else the value in cmux's Settings. If that appearance is System, Intelligent UI uses the OS appearance. If `terminal.adaptiveDefaultTheme` is `false` in `cmux.json`, Intelligent UI uses the Ghostty rules above.
+3. **The kitty config:** the `background` in `kitty.conf` and in the files that it includes (`include` lines only). The themes kitten writes such an include. If the config folder has `dark-theme.auto.conf`, `light-theme.auto.conf` or `no-preference-theme.auto.conf` (kitty 0.38 and later), Intelligent UI uses the file for the OS appearance, as kitty does. With no `background`, it uses kitty's default (`#000000`, dark). The config folder is `KITTY_CONFIG_DIRECTORY`. If that is not set, it is the first of `$XDG_CONFIG_HOME/kitty`, `~/.config/kitty` and (on macOS) `~/Library/Preferences/kitty` that has a `kitty.conf`.
+4. **The Rio config:** `config.toml` in `RIO_CONFIG_HOME`, else in `~/.config/rio` (on Linux, `$XDG_CONFIG_HOME/rio` if that is set). With an `[adaptive-theme]`, Intelligent UI reads the theme file for `force-theme`, else for the OS appearance. Else it reads the file for `theme`, else the `[colors] background`. Theme files are in the `themes` folder. With no background, it uses Rio's default (`#0F0D0E`, dark).
5. **`COLORFGBG`**, as it was when Claude Code started. Ghostty does not set it.
6. **The OS appearance:** macOS Dark or Light, or GNOME's `color-scheme` on Linux.
7. **Dark.**
The terminal comes before the OS: a dark terminal on a light Mac is dark.
-md-preview checks every 3 s. After a change, each mode's pictures compile once. `/md-preview probe` asks the terminal for its background with OSC 11 (5 times) and shows the raw answers. This is a test of whether the answer can reach the mod. The 3 s check does not use OSC 11 yet.
+Intelligent UI checks every 3 s. After a change, each mode's pictures compile once. `/md-preview probe` asks the terminal for its background with OSC 11 (5 times) and shows the raw answers. This is a test of whether the answer can reach the mod. The 3 s check does not use OSC 11 yet.
## Limitations
@@ -178,7 +181,7 @@ md-preview checks every 3 s. After a change, each mode's pictures compile once.
- **The look is close to VS Code, not exact:** Typst does not use CSS. Raw HTML in Markdown is shown in a simple form or dropped. Loose lists have tight spacing.
- **A picture that the terminal dropped from its image memory** (after many large pictures) is not sent again when you scroll back to it.
- **Over ssh**, the mod cannot read the terminal's config on your computer. So it uses Menlo metrics for the text size, and `auto` uses `COLORFGBG` if ssh sends it. Else `auto` is dark. The mod does not use the OS appearance of the remote computer. Pages are shorter, so that each one is at most 4096 pixels tall. In tmux or screen on the remote computer, no pictures show.
-- **`auto` theme** reads the iTerm2 profile, the Ghostty, kitty and Rio configs, and the cmux settings directly. It does not read kitty's `globinclude`, `envinclude` and `geninclude` lines, or colours that you set while kitty runs. In other terminals, it uses `COLORFGBG` (set only when the terminal starts), then the OS appearance. If you change the theme of such a terminal and the OS appearance does not change, md-preview does not see it. A change shows after up to 3 s.
+- **`auto` theme** reads the iTerm2 profile, the Ghostty, kitty and Rio configs, and the cmux settings directly. It does not read kitty's `globinclude`, `envinclude` and `geninclude` lines, or colours that you set while kitty runs. In other terminals, it uses `COLORFGBG` (set only when the terminal starts), then the OS appearance. If you change the theme of such a terminal and the OS appearance does not change, Intelligent UI does not see it. A change shows after up to 3 s.
## Develop
diff --git a/THIRD-PARTY-NOTICES.md b/THIRD-PARTY-NOTICES.md
index 25ecded..103da9b 100644
--- a/THIRD-PARTY-NOTICES.md
+++ b/THIRD-PARTY-NOTICES.md
@@ -1,6 +1,6 @@
# Third-party notices
-md-preview is MIT licensed (see `LICENSE`). It includes the work of others, each under its own licence. Each folder below holds that project's licence file.
+Intelligent UI is MIT licensed (see `LICENSE`). It includes the work of others, each under its own licence. Each folder below holds that project's licence file.
## Typst packages (in `render/packages/preview/`)
@@ -20,9 +20,9 @@ cetz 0.3.4 and oxifmt are there because other packages import them.
cetz and cetz-plot are under the LGPL-3.0. Their full licence text is in their folders. The LGPL-3.0 refers to the GPL-3.0, which is at https://www.gnu.org/licenses/gpl-3.0.html.
-## VS Code (in `render/themes/vscode/` and `render/themes/vscode-modern/`)
+## VS Code (in `render/themes/vscode/`, `render/themes/vscode-modern/` and `render/themes/claude-code/`)
-The colours, sizes and spacing of the two built-in themes come from [VS Code](https://github.com/microsoft/vscode): its Markdown preview styles (`markdown.css`, `highlight.css`) and its Dark+, Light+, Dark Modern and Light Modern themes. MIT, Copyright (c) 2015 - present Microsoft Corporation. The `source` key in each `theme.json` names the files.
+The colours, sizes and spacing of the `vscode` and `vscode-modern` themes come from [VS Code](https://github.com/microsoft/vscode): its Markdown preview styles (`markdown.css`, `highlight.css`) and its Dark+, Light+, Dark Modern and Light Modern themes. The `claude-code` theme uses the ANSI colours of the VS Code terminal (`terminalColorRegistry.ts`) and the syntax scopes of the `vscode` theme. MIT, Copyright (c) 2015 - present Microsoft Corporation. The `source` key in each `theme.json` names the files.
## show-your-work
diff --git a/hooks/lib/settings.ts b/hooks/lib/settings.ts
index 59e3a60..3982abd 100644
--- a/hooks/lib/settings.ts
+++ b/hooks/lib/settings.ts
@@ -67,7 +67,7 @@ export const HOST_CHECK_MS = 2000
// The base every theme merges over (its theme.json and syntax files).
export const BASE_THEME = 'vscode'
// The theme used when none is chosen, or when the chosen one is not usable.
-export const DEFAULT_THEME = 'vscode-modern'
+export const DEFAULT_THEME = 'claude-code'
// The two modes a theme has syntax colours for.
export const MODES = ['dark', 'light'] as const
// A picture under a row (an image Claude sends, an image the user pastes)
diff --git a/marketing/out/0-hero.png b/marketing/out/0-hero.png
deleted file mode 100644
index 9b726cc..0000000
Binary files a/marketing/out/0-hero.png and /dev/null differ
diff --git a/marketing/out/1-overview-dark.png b/marketing/out/1-overview-dark.png
deleted file mode 100644
index 37d3a7c..0000000
Binary files a/marketing/out/1-overview-dark.png and /dev/null differ
diff --git a/marketing/out/1-overview-light.png b/marketing/out/1-overview-light.png
deleted file mode 100644
index 2d69472..0000000
Binary files a/marketing/out/1-overview-light.png and /dev/null differ
diff --git a/marketing/out/2-math-dark.png b/marketing/out/2-math-dark.png
deleted file mode 100644
index cf92cb2..0000000
Binary files a/marketing/out/2-math-dark.png and /dev/null differ
diff --git a/marketing/out/2-math-light.png b/marketing/out/2-math-light.png
deleted file mode 100644
index f36c7a0..0000000
Binary files a/marketing/out/2-math-light.png and /dev/null differ
diff --git a/marketing/out/3-mandelbrot-dark.png b/marketing/out/3-mandelbrot-dark.png
deleted file mode 100644
index 4934558..0000000
Binary files a/marketing/out/3-mandelbrot-dark.png and /dev/null differ
diff --git a/marketing/out/3-mandelbrot-light.png b/marketing/out/3-mandelbrot-light.png
deleted file mode 100644
index 43bd350..0000000
Binary files a/marketing/out/3-mandelbrot-light.png and /dev/null differ
diff --git a/marketing/out/4-fractal-dark.png b/marketing/out/4-fractal-dark.png
deleted file mode 100644
index 25d649e..0000000
Binary files a/marketing/out/4-fractal-dark.png and /dev/null differ
diff --git a/marketing/out/4-fractal-light.png b/marketing/out/4-fractal-light.png
deleted file mode 100644
index 593286d..0000000
Binary files a/marketing/out/4-fractal-light.png and /dev/null differ
diff --git a/marketing/out/5-plot-dark.png b/marketing/out/5-plot-dark.png
deleted file mode 100644
index 98c353f..0000000
Binary files a/marketing/out/5-plot-dark.png and /dev/null differ
diff --git a/marketing/out/5-plot-light.png b/marketing/out/5-plot-light.png
deleted file mode 100644
index 78c3674..0000000
Binary files a/marketing/out/5-plot-light.png and /dev/null differ
diff --git a/marketing/out/6-diagrams-dark.png b/marketing/out/6-diagrams-dark.png
deleted file mode 100644
index eca871d..0000000
Binary files a/marketing/out/6-diagrams-dark.png and /dev/null differ
diff --git a/marketing/out/6-diagrams-light.png b/marketing/out/6-diagrams-light.png
deleted file mode 100644
index 7d482cc..0000000
Binary files a/marketing/out/6-diagrams-light.png and /dev/null differ
diff --git a/marketing/samples/1-overview.md b/marketing/samples/1-overview.md
deleted file mode 100644
index 59be8e2..0000000
--- a/marketing/samples/1-overview.md
+++ /dev/null
@@ -1,18 +0,0 @@
-## Markdown basics
-
-| Feature | Syntax | Status |
-|:--|:--:|--:|
-| Tables with alignment | `\|:--\|:--:\|--:\|` | ✅ |
-| Task lists | `- [x]` | ✅ |
-| Inline + display math | `$…$`, `$$…$$` | ✅ |
-| Live Typst drawings | ` ```typst ` | ✅ |
-
-- [x] Render Markdown
-- [x] Render LaTeX math
-- [x] Compile Typst live
-- [ ] Make coffee
-
-> **Note**
-> > Nested quotes also work.
-
-Euler's identity: $e^{i\pi} + 1 = 0$. The Gaussian integral: $\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}$.
diff --git a/marketing/samples/3-mandelbrot.md b/marketing/samples/3-mandelbrot.md
deleted file mode 100644
index 7f35b2a..0000000
--- a/marketing/samples/3-mandelbrot.md
+++ /dev/null
@@ -1,37 +0,0 @@
-## A Mandelbrot set, calculated in Typst
-
-Typst calculates each pixel at render time: 4,000 cells and up to 50 iterations per cell.
-
-```typst
-#let W = 80
-#let H = 50
-#let maxit = 50
-#let cell = calc.min(theme.width / W, theme.height / H)
-#let grad = gradient.linear(..color.map.magma)
-#let mandel(cx, cy) = {
- let x = 0.0
- let y = 0.0
- let i = 0
- while i < maxit and x * x + y * y <= 4.0 {
- let xt = x * x - y * y + cx
- y = 2.0 * x * y + cy
- x = xt
- i += 1
- }
- i
-}
-#align(center, grid(
- columns: (cell,) * W,
- rows: (cell,) * H,
- gutter: 0pt,
- ..for j in range(H) {
- for i in range(W) {
- let n = mandel(-2.2 + 3.2 * i / W, -1.0 + 2.0 * j / H)
- let c = if n == maxit { black } else {
- grad.sample((0.12 + 0.88 * calc.sqrt(n / maxit)) * 100%)
- }
- (box(width: cell, height: cell, fill: c),)
- }
- }
-))
-```
diff --git a/marketing/.gitignore b/outcomes/.gitignore
similarity index 100%
rename from marketing/.gitignore
rename to outcomes/.gitignore
diff --git a/marketing/build.sh b/outcomes/build.sh
similarity index 73%
rename from marketing/build.sh
rename to outcomes/build.sh
index d90978d..a41df3f 100755
--- a/marketing/build.sh
+++ b/outcomes/build.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# Renders the sample answers with md-preview's own template, then frames them.
-# Usage: marketing/build.sh (needs typst 0.15)
+# Usage: outcomes/build.sh (needs typst 0.15)
#
# The template gets the inputs the mod gives it (hooks/lib/typst.ts runTypst,
# draw.tsx sizing/fontFit/alignFirstLine, answer.ts roomOf) for a terminal of
@@ -15,7 +15,7 @@ mkdir -p "$out/raw" "$work/pkg-cache"
export TYPST_PACKAGE_CACHE_PATH="$work/pkg-cache"
cols=${COLS:-118}; rows=${ROWS:-50}; cell_w=${CELL_W:-16}; cell_h=${CELL_H:-32}
ppi=${PPI:-288}; font=${TERM_FONT:-MesloLGS NF}; img_w=${IMG_W:-600}
-theme_dir="$root/render/themes/vscode-modern"
+theme_dir="$root/render/themes/claude-code"
# The font fit: the pt of one column and the code size (draw.tsx fontFit).
metrics=$(typst eval 'query(<m>).first().value' --in "$root/render/measure.typ" --root / \
@@ -74,47 +74,47 @@ render() {
"$root/render/md.typ" "$out/raw/$name-$mode-{0p}.png"
done
}
-for md in "$here"/samples/*.md; do render "$md" "$(basename "$md" .md)" "$cols"; done
-# The hero's windows are narrower: the same answer in a terminal of HERO_COLS.
-hero=3-mandelbrot; hero_cols=${HERO_COLS:-96}; hero_w=${HERO_W:-520}
-render "$here/samples/$hero.md" hero "$hero_cols"
+for md in "$here"/samples/[0-9]*.md; do render "$md" "$(basename "$md" .md)" "$cols"; done
+# The heroes' windows are narrower: their own answers (samples/hero-*.md) in a terminal of HERO_COLS.
+hero_cols=${HERO_COLS:-96}; hero_w=${HERO_W:-520}
+for md in "$here"/samples/hero-*.md; do render "$md" "$(basename "$md" .md)" "$hero_cols"; done
ls "$out/raw"
# The bullet offset of a sample (pt), from sizes().
bullet() { cut -d' ' -f2 "$work/$1.top"; }
-# Frames: headline, subline and the prompt for each sample.
-frame() { # name title sub ask
+# Frames: headline and the prompt for each sample.
+frame() { # name title ask
for mode in dark light; do
typst compile --root / --ppi 216 --input img="$out/raw/$1-$mode-1.png" --input mode=$mode --input bullet="$(bullet "$1")" \
- --input img-w="$img_w" --input title="$2" --input sub="$3" --input ask="$4" "$here/frame.typ" "$out/$1-$mode.png" 2>/dev/null
+ --input img-w="$img_w" --input title="$2" --input ask="$3" "$here/frame.typ" "$out/$1-$mode.png" 2>/dev/null
done
}
frame 1-overview "Real Markdown, right in the terminal" \
- "Tables, task lists, quotes and math, drawn like VS Code's preview." \
"show me what Markdown you can draw"
frame 2-math "LaTeX math that reads like a paper" \
- "Inline and display math, matrices and cases, set by Typst." \
"write out Maxwell's equations"
frame 3-mandelbrot "A fractal, calculated as it draws" \
- "Claude writes the code; Typst runs it and paints 4,000 cells." \
"draw the Mandelbrot set"
frame 4-fractal "Recursion and colour, live" \
- "A 2,047-branch tree and a 720-segment curve, drawn with CeTZ." \
"draw a fractal tree next to a Lissajous curve"
frame 5-plot "Plots with axes and a legend" \
- "cetz-plot draws functions in your theme's colours." \
"plot a damped oscillator"
frame 6-diagrams "Flow charts and commutative diagrams" \
- "fletcher draws boxes, arrows and maths from a few lines of text." \
"diagram the agent loop and the first isomorphism theorem"
ls "$out"
-# Hero: the same answer in a dark and a light terminal.
-typst compile --root / --ppi 180 --input layout=hero --input mode=dark --input img-w="$hero_w" \
- --input bullet="$(python3 -c 'import sys; print(round((float(sys.argv[1]) + 4.2) * float(sys.argv[2]) / float(sys.argv[3]) - 4.2, 2))' "$(bullet hero)" "$hero_w" "$img_w")" \
- --input img-dark="$out/raw/hero-dark-1.png" --input img-light="$out/raw/hero-light-1.png" \
- --input title="Claude's answers, rendered" \
- --input sub="Markdown, math and live Typst drawings, in the colours of your terminal." \
- --input ask="Demonstrate some insane capabilities of md-preview" "$here/frame.typ" "$out/0-hero.png" 2>/dev/null
+# Heroes: each answer in a dark and a light terminal.
+hero() { # name title ask
+ typst compile --root / --ppi 180 --input layout=hero --input mode=dark --input img-w="$hero_w" \
+ --input bullet="$(python3 -c 'import sys; print(round((float(sys.argv[1]) + 4.2) * float(sys.argv[2]) / float(sys.argv[3]) - 4.2, 2))' "$(bullet "hero-$1")" "$hero_w" "$img_w")" \
+ --input img-dark="$out/raw/hero-$1-dark-1.png" --input img-light="$out/raw/hero-$1-light-1.png" \
+ --input title="$2" --input ask="$3" "$here/frame.typ" "$out/0-hero-$1.png" 2>/dev/null
+}
+hero 1-attention "Claude's answers, rendered" \
+ "Explain attention in a transformer"
+hero 2-latency "See the problem at a glance" \
+ "Why is my API request slow?"
+hero 3-rebase "Ideas, drawn as Claude explains them" \
+ "Explain git rebase with a picture"
ls "$out"
diff --git a/marketing/frame.typ b/outcomes/frame.typ
similarity index 87%
rename from marketing/frame.typ
rename to outcomes/frame.typ
index 2648240..8c3d1cd 100644
--- a/marketing/frame.typ
+++ b/outcomes/frame.typ
@@ -1,7 +1,7 @@
-// Marketing frame: md-preview renders in terminal windows, with a headline.
+// Outcome frame: md-preview renders in terminal windows, with a headline.
// One window: --input img=<abs png> --input mode=dark|light --input ask=..
// Hero (two): --input layout=hero --input img-dark=.. --input img-light=.. --input ask=..
-// Both: --input title=.. --input sub=.. (typst compile --root / frame.typ out.png)
+// Both: --input title=.. (typst compile --root / frame.typ out.png)
#let inp = sys.inputs
#let hero = inp.at("layout", default: "one") == "hero"
#let page-dark = inp.at("mode", default: "dark") == "dark"
@@ -48,7 +48,7 @@
mascot(0.42pt, rgb("#d77757"), c.eye),
[*Claude Code* #text(fill: c.dim)[v2.1.301] \
#text(fill: c.dim)[Opus 5.5 with high effort · Claude Max] \
- #text(fill: c.dim)[\~/projects/md-preview ·] #text(fill: c.green)[/rc]])
+ #text(fill: c.dim)[\~/projects/intelligent-ui ·] #text(fill: c.green)[/rc]])
#v(14pt)
#block(width: 100%, fill: c.ask-bg, inset: (x: 4pt, y: 4pt), below: 0pt)[❯ #ask]
#v(12pt)
@@ -79,11 +79,14 @@
#set text(font: sans, fill: if page-dark { white } else { rgb("#1d1d1f") })
#align(center)[
- #text(size: 11pt, weight: "semibold", tracking: 1.5pt, fill: rgb("#d97757"))[MD-PREVIEW FOR CLAUDE CODE]
- #v(4pt)
- #text(size: if hero { 32pt } else { 27pt }, weight: "bold")[#inp.at("title", default: "")]
- #v(-6pt)
- #text(size: 13pt, fill: if page-dark { rgb("#b8b8c8") } else { rgb("#5d5d6b") })[#inp.at("sub", default: "")]
+ // The brand line is on the heroes only; on a single frame the title is the heading.
+ #if hero [
+ #text(size: 34pt, weight: "bold", tracking: 2pt, fill: rgb("#d97757"))[INTELLIGENT UI FOR CLAUDE CODE]
+ #v(-2pt)
+ #text(size: 24pt, weight: "semibold")[#inp.at("title", default: "")]
+ ] else [
+ #text(size: 27pt, weight: "bold")[#inp.at("title", default: "")]
+ ]
]
#v(14pt)
#let ask = inp.at("ask", default: "")
diff --git a/outcomes/out/0-hero-1-attention.png b/outcomes/out/0-hero-1-attention.png
new file mode 100644
index 0000000..5670c67
Binary files /dev/null and b/outcomes/out/0-hero-1-attention.png differ
diff --git a/outcomes/out/0-hero-2-latency.png b/outcomes/out/0-hero-2-latency.png
new file mode 100644
index 0000000..3b9282b
Binary files /dev/null and b/outcomes/out/0-hero-2-latency.png differ
diff --git a/outcomes/out/0-hero-3-rebase.png b/outcomes/out/0-hero-3-rebase.png
new file mode 100644
index 0000000..49eae4d
Binary files /dev/null and b/outcomes/out/0-hero-3-rebase.png differ
diff --git a/outcomes/out/1-overview-dark.png b/outcomes/out/1-overview-dark.png
new file mode 100644
index 0000000..a8c9ae2
Binary files /dev/null and b/outcomes/out/1-overview-dark.png differ
diff --git a/outcomes/out/1-overview-light.png b/outcomes/out/1-overview-light.png
new file mode 100644
index 0000000..cabc4b8
Binary files /dev/null and b/outcomes/out/1-overview-light.png differ
diff --git a/outcomes/out/2-math-dark.png b/outcomes/out/2-math-dark.png
new file mode 100644
index 0000000..98f857e
Binary files /dev/null and b/outcomes/out/2-math-dark.png differ
diff --git a/outcomes/out/2-math-light.png b/outcomes/out/2-math-light.png
new file mode 100644
index 0000000..f52fd20
Binary files /dev/null and b/outcomes/out/2-math-light.png differ
diff --git a/outcomes/out/3-mandelbrot-dark.png b/outcomes/out/3-mandelbrot-dark.png
new file mode 100644
index 0000000..9d06511
Binary files /dev/null and b/outcomes/out/3-mandelbrot-dark.png differ
diff --git a/outcomes/out/3-mandelbrot-light.png b/outcomes/out/3-mandelbrot-light.png
new file mode 100644
index 0000000..3dab117
Binary files /dev/null and b/outcomes/out/3-mandelbrot-light.png differ
diff --git a/outcomes/out/4-fractal-dark.png b/outcomes/out/4-fractal-dark.png
new file mode 100644
index 0000000..3648979
Binary files /dev/null and b/outcomes/out/4-fractal-dark.png differ
diff --git a/outcomes/out/4-fractal-light.png b/outcomes/out/4-fractal-light.png
new file mode 100644
index 0000000..799e1d2
Binary files /dev/null and b/outcomes/out/4-fractal-light.png differ
diff --git a/outcomes/out/5-plot-dark.png b/outcomes/out/5-plot-dark.png
new file mode 100644
index 0000000..df0a52c
Binary files /dev/null and b/outcomes/out/5-plot-dark.png differ
diff --git a/outcomes/out/5-plot-light.png b/outcomes/out/5-plot-light.png
new file mode 100644
index 0000000..6c9490b
Binary files /dev/null and b/outcomes/out/5-plot-light.png differ
diff --git a/outcomes/out/6-diagrams-dark.png b/outcomes/out/6-diagrams-dark.png
new file mode 100644
index 0000000..3d002e4
Binary files /dev/null and b/outcomes/out/6-diagrams-dark.png differ
diff --git a/outcomes/out/6-diagrams-light.png b/outcomes/out/6-diagrams-light.png
new file mode 100644
index 0000000..1f9abba
Binary files /dev/null and b/outcomes/out/6-diagrams-light.png differ
diff --git a/outcomes/samples/1-overview.md b/outcomes/samples/1-overview.md
new file mode 100644
index 0000000..d9c6345
--- /dev/null
+++ b/outcomes/samples/1-overview.md
@@ -0,0 +1,27 @@
+Here is one answer with everything Intelligent UI draws:
+
+![Introducing Intelligent UI](intelligent-ui.png)
+
+## Real documents, not raw text
+
+Claude's answers arrive with **headings**, *emphasis*, `inline code`, [links](https://github.com/razorback16/claude-md-preview) and pictures like the one above.
+
+| Element | You write | You see |
+|:--|:--|:--:|
+| Table | `\| a \| b \|` | aligned columns |
+| Task list | `- [x] done` | checkboxes |
+| Math | `$e^{i\pi} + 1 = 0$` | $e^{i\pi} + 1 = 0$ |
+| Image | `![alt](cover.png)` | the picture |
+
+```ts
+// Syntax colours in Claude Code's own palette
+export async function draw(answer: string): Promise<Picture> {
+ return typst.compile(answer, { theme: "claude-code" })
+}
+```
+
+- [x] Draw Markdown in the terminal
+- [x] Set LaTeX math and run live Typst
+- [ ] Make coffee
+
+> **Note:** Typst draws everything on your computer. The saved answer stays Markdown.
diff --git a/marketing/samples/2-math.md b/outcomes/samples/2-math.md
similarity index 100%
rename from marketing/samples/2-math.md
rename to outcomes/samples/2-math.md
diff --git a/outcomes/samples/3-mandelbrot.md b/outcomes/samples/3-mandelbrot.md
new file mode 100644
index 0000000..0da98c9
--- /dev/null
+++ b/outcomes/samples/3-mandelbrot.md
@@ -0,0 +1,32 @@
+## A Mandelbrot set, calculated in Typst
+
+Typst calculates each pixel at render time: 100,000 pixels, up to 120 iterations each, with smooth colouring.
+
+```typst
+#let W = 400
+#let H = 250
+#let maxit = 120
+// 256 magma colours as RGB bytes, so a pixel is one lookup.
+#let grad = gradient.linear(..color.map.magma)
+#let lut = range(256).map(k => grad.sample(k / 255 * 100%)
+ .rgb().components().slice(0, 3).map(v => int(calc.round(v / 100% * 255))))
+#let px = ()
+#for j in range(H) {
+ let cy = -1.0 + 2.0 * j / (H - 1)
+ for i in range(W) {
+ let cx = -2.2 + 3.2 * i / (W - 1)
+ let (x, y, n) = (0.0, 0.0, 0)
+ while n < maxit and x * x + y * y <= 65536.0 {
+ (x, y) = (x * x - y * y + cx, 2.0 * x * y + cy)
+ n += 1
+ }
+ px += if n == maxit { (0, 0, 0) } else {
+ // A fractional escape count: no colour bands.
+ let nu = n + 1 - calc.log(calc.ln(x * x + y * y) / 2, base: 2)
+ lut.at(calc.clamp(int(255 * (0.08 + 0.92 * calc.ln(calc.max(nu, 1)) / calc.ln(maxit))), 0, 255))
+ }
+ }
+}
+#align(center, image(bytes(px), format: (encoding: "rgb8", width: W, height: H),
+ width: calc.min(theme.width, theme.height * W / H)))
+```
diff --git a/marketing/samples/4-fractal.md b/outcomes/samples/4-fractal.md
similarity index 100%
rename from marketing/samples/4-fractal.md
rename to outcomes/samples/4-fractal.md
diff --git a/marketing/samples/5-plot.md b/outcomes/samples/5-plot.md
similarity index 100%
rename from marketing/samples/5-plot.md
rename to outcomes/samples/5-plot.md
diff --git a/marketing/samples/6-diagrams.md b/outcomes/samples/6-diagrams.md
similarity index 100%
rename from marketing/samples/6-diagrams.md
rename to outcomes/samples/6-diagrams.md
diff --git a/outcomes/samples/hero-1-attention.md b/outcomes/samples/hero-1-attention.md
new file mode 100644
index 0000000..5a76508
--- /dev/null
+++ b/outcomes/samples/hero-1-attention.md
@@ -0,0 +1,47 @@
+## How attention works, in one picture
+
+Each word asks every earlier word: *how much should I listen to you?* The row for **it** looks back at **cat**. That is how the model knows what *it* means.
+
+$$\mathrm{Attention}(Q, K, V) = \mathrm{softmax}\left(\frac{QK^\top}{\sqrt{d_k}}\right) V$$
+
+```typst
+#let words = ("The", "cat", "sat", "on", "the", "mat", "because", "it", "was", "tired")
+#let n = words.len()
+// Raw scores q·k/√d for a few strong links; every other earlier word scores 0.
+#let strong = ((1, 0, 1.2), (2, 1, 2.4), (3, 2, 2.0), (4, 3, 1.6), (5, 4, 2.2), (5, 2, 1.0),
+ (6, 2, 1.8), (7, 1, 3.6), (7, 5, 1.1), (8, 7, 2.6), (9, 1, 2.3), (9, 7, 1.7))
+#let score(i, j) = strong.find(s => s.at(0) == i and s.at(1) == j)
+#let weights = range(n).map(i => {
+ // softmax over the words up to i (a causal mask hides the later ones)
+ let e = range(i + 1).map(j => { let s = score(i, j); calc.exp(if s == none { 0.0 } else { s.at(2) }) })
+ let z = e.sum()
+ range(n).map(j => if j <= i { e.at(j) / z } else { none })
+})
+#let label-w = 0.17 * theme.width
+#let cell = calc.min((theme.width - label-w) / n, theme.height / (n + 1.7))
+#let heat = gradient.linear(theme.bg, theme.purple.lighten(20%), theme.orange)
+#let small = text.with(size: 0.3 * cell, fill: theme.muted)
+#align(center, grid(
+ columns: (label-w,) + (cell,) * n,
+ rows: (auto,) + (cell,) * n,
+ align: (x, y) => if x == 0 { right + horizon } else { center + bottom },
+ [], ..words.map(w => box(height: 1.6 * cell, align(bottom, rotate(-55deg, reflow: true, small(w))))),
+ ..for i in range(n) {
+ (pad(right: 0.2 * cell, text(size: 0.34 * cell, weight: if i == 7 { "bold" } else { "regular" },
+ fill: if i == 7 { theme.orange } else { theme.fg }, words.at(i))),)
+ for j in range(n) {
+ let w = weights.at(i).at(j)
+ (if w == none { box(width: cell, height: cell) } else {
+ let c = heat.sample(100% * calc.min(1, 0.06 + 1.1 * w))
+ box(width: cell, height: cell, inset: 0.04 * cell, box(width: 100%, height: 100%, radius: 0.12 * cell, fill: c,
+ stroke: if i == 7 and j == 1 { 0.07 * cell + theme.fg } else { none },
+ align(center + horizon, if w > 0.3 { text(size: 0.26 * cell, fill: white, weight: "bold", str(calc.round(w * 100)) + "%") })))
+ },)
+ }
+ }
+))
+```
+
+- $Q$, the **query**: what this word looks for
+- $K$, the **key**: what each word offers
+- $V$, the **value**: what it passes on when it is chosen
diff --git a/outcomes/samples/hero-2-latency.md b/outcomes/samples/hero-2-latency.md
new file mode 100644
index 0000000..e3b6f94
--- /dev/null
+++ b/outcomes/samples/hero-2-latency.md
@@ -0,0 +1,46 @@
+## Where your 450 ms go
+
+`GET /api/orders` takes **450 ms**. The **DB query** is 69% of it, so that is the fix that counts.
+
+```typst
+#let spans = (("DNS", 0, 12), ("TCP + TLS", 12, 50), ("Auth", 50, 74),
+ ("DB query", 74, 384), ("Render JSON", 384, 430), ("Send", 430, 450))
+#let total = 450
+#let label-w = 0.2 * theme.width
+#let bar-w = theme.width - label-w - 0.12 * theme.width
+#let row-h = calc.min(0.075 * theme.width, theme.height / (spans.len() + 1.6))
+#let x(ms) = ms / total * bar-w
+#let lane(body) = box(width: bar-w, height: row-h, body)
+#align(center, grid(
+ columns: (label-w, bar-w + 0.12 * theme.width), rows: row-h, align: (right + horizon, left + horizon),
+ column-gutter: 0.25 * row-h,
+ ..for (name, a, b) in spans {
+ let hot = name == "DB query"
+ let col = if hot { theme.orange } else { theme.blue }
+ (text(weight: if hot { "bold" } else { "regular" }, fill: if hot { col } else { theme.fg }, name),
+ lane({
+ place(dx: 0pt, line(length: row-h, angle: 90deg, stroke: 0.6pt + theme.border))
+ place(horizon, dx: x(a), rect(width: calc.max(x(b - a), 0.12 * row-h), height: 0.62 * row-h, radius: 0.16 * row-h, fill: col))
+ place(horizon, dx: x(b) + 0.15 * row-h, text(size: 0.9em, fill: theme.muted, str(b - a) + " ms"))
+ }))
+ },
+ [], lane({
+ place(line(length: bar-w, stroke: 0.6pt + theme.border))
+ for t in range(0, total + 1, step: 100) {
+ place(dx: x(t), line(length: 0.18 * row-h, angle: 90deg, stroke: 0.6pt + theme.border))
+ place(dx: x(t) - 0.6 * row-h, dy: 0.25 * row-h, box(width: 1.2 * row-h, align(center,
+ text(size: 0.85em, fill: theme.muted, str(t) + if t == 400 { " ms" } else { "" }))))
+ }
+ }),
+))
+```
+
+Make the DB query 4× faster and the request is only about 2× faster. That is Amdahl's law, with $p = 0.69$ of the time sped up $s = 4$ times:
+
+$$S = \frac{1}{(1 - p) + \frac{p}{s}} = \frac{1}{0.31 + \frac{0.69}{4}} \approx 2.1$$
+
+| Fix | New time | Faster |
+|:--|--:|--:|
+| Cache the orders (no DB query) | 140 ms | **3.2×** |
+| An index makes the query 4× faster | 218 ms | 2.1× |
+| HTTP/3 0-RTT (no TLS round trip) | 412 ms | 1.1× |
diff --git a/outcomes/samples/hero-3-rebase.md b/outcomes/samples/hero-3-rebase.md
new file mode 100644
index 0000000..d38faa7
--- /dev/null
+++ b/outcomes/samples/hero-3-rebase.md
@@ -0,0 +1,51 @@
+## `git rebase main`, in one picture
+
+Your branch's commits move onto the newest `main`. The history becomes one straight line.
+
+```typst
+#import "@preview/cetz:0.5.2"
+#let u = calc.min(theme.width / 8.2, theme.height / 4.4)
+#align(center, cetz.canvas(length: u, {
+ import cetz.draw: *
+ let (main, feat) = (theme.blue, theme.orange)
+ let line-w = 0.08 * u
+ let commit(p, name, col) = {
+ circle(p, radius: 0.3, fill: col, stroke: none)
+ content(p, text(fill: theme.bg, size: 0.27 * u, weight: "bold", font: theme.sans, name))
+ }
+ let tag(p, name, col) = content(p, box(fill: col.transparentize(82%), stroke: 0.06 * u + col,
+ inset: (x: 0.12 * u, y: 0.07 * u), radius: 0.1 * u,
+ text(fill: col, size: 0.22 * u, font: theme.mono, weight: "bold", name)))
+ let label(y, body) = content((-0.6, y), anchor: "east", text(fill: theme.muted, size: 0.26 * u, body))
+
+ // Before: feature leaves main at B; main has moved on to D.
+ label(0, [before])
+ line((0, 0), (3, 0), stroke: line-w + main)
+ bezier((1, 0), (3, -0.9), (2, -0.9), (1.4, -0.9), stroke: line-w + feat)
+ for (x, n) in ((0, "A"), (1, "B"), (2, "C"), (3, "D")) { commit((x, 0), n, main) }
+ commit((2, -0.9), "E", feat)
+ commit((3, -0.9), "F", feat)
+ tag((3.9, 0), "main", main)
+ tag((4.05, -0.9), "feature", feat)
+
+ // The move.
+ line((1.5, -1.45), (1.5, -2.15), stroke: line-w + theme.fg, mark: (end: ">", fill: theme.fg))
+ content((1.75, -1.8), anchor: "west", text(size: 0.24 * u, font: theme.mono, fill: theme.fg)[git rebase main])
+
+ // After: E and F are replayed on top of D, as new commits E′ and F′.
+ label(-2.7, [after])
+ line((0, -2.7), (3, -2.7), stroke: line-w + main)
+ line((3, -2.7), (5, -2.7), stroke: line-w + feat)
+ for (x, n) in ((0, "A"), (1, "B"), (2, "C"), (3, "D")) { commit((x, -2.7), n, main) }
+ commit((4, -2.7), "E′", feat)
+ commit((5, -2.7), "F′", feat)
+ tag((3, -3.3), "main", main)
+ tag((5, -3.3), "feature", feat)
+}))
+```
+
+| | Merge | Rebase |
+|:--|:--:|:--:|
+| History | fork + merge commit | one straight line |
+| Commit IDs | kept | new for your commits |
+| Safe on a shared branch | yes | no, rewrites history |
diff --git a/outcomes/samples/intelligent-ui.png b/outcomes/samples/intelligent-ui.png
new file mode 100644
index 0000000..f95447d
Binary files /dev/null and b/outcomes/samples/intelligent-ui.png differ
diff --git a/render/md.typ b/render/md.typ
index 1c09102..fc827b0 100644
--- a/render/md.typ
+++ b/render/md.typ
@@ -189,8 +189,15 @@
marker: E.list.markers.map(list-marker),
indent: E.list.indent-em * 1em, body-indent: E.list.gap-em * 1em, spacing: E.list.item-spacing-em * 1em,
)
+// list.numbering is one Typst pattern: its counting symbols are the nesting
+// levels ("1.a.i." gives 1., a., i.), and the last one repeats. A pattern
+// with no counting symbol fails the compile, so it gets "1." instead.
+#let enum-numbering = {
+ let p = E.list.numbering
+ if type(p) == str and p.match(regex("[1aAiI*αΑא一壹あいアイㄱ가①⓵]")) != none { p } else { "1." }
+}
#set enum(
- numbering: "1.",
+ numbering: enum-numbering,
indent: E.list.number-indent-em * 1em, body-indent: E.list.number-gap-em * 1em, spacing: E.list.item-spacing-em * 1em,
)
@@ -222,15 +229,18 @@
h(pad-x)
}
// Code blocks: VS Code's `pre` (padding 16px, radius 3px, 1px border) with
-// `code { line-height: 1.357em }`.
+// `code { line-height: 1.357em }`. A block with no language has its own
+// colour, code-plain-fg, when the theme sets one (Typst gives unscoped code
+// the text colour, not the tmTheme's).
#show raw.where(block: true): it => context {
+ let fg = if it.lang == none { C.at("code-plain-fg", default: C.code-fg) } else { C.code-fg }
let CB = E.code-block
let area = measure(text(top-edge: "ascender", bottom-edge: "descender", "x")).height
set par(leading: calc.max(0pt, CB.line-height * text.size - area), justify: false)
block(
width: 100%, fill: C.code-bg, stroke: CB.border-px * px + C.code-border,
radius: CB.radius-px * px, inset: CB.pad-px * px, above: 1.2em, below: 1.2em,
- text(fill: C.code-fg, it),
+ text(fill: fg, it),
)
}
diff --git a/render/themes/README.md b/render/themes/README.md
index b063f40..9e2dc85 100644
--- a/render/themes/README.md
+++ b/render/themes/README.md
@@ -1,17 +1,18 @@
-# md-preview themes
+# Intelligent UI themes
-A theme is a folder with a `theme.json`. md-preview ships two:
+A theme is a folder with a `theme.json`. Intelligent UI ships three:
| Folder | Name | Looks like |
|---|---|---|
-| `vscode-modern` (default) | VS Code Modern | VS Code's Markdown preview, Dark Modern / Light Modern |
+| `claude-code` (default) | Claude Code | Claude Code's own Markdown in the terminal, with its dark and light themes |
+| `vscode-modern` | VS Code Modern | VS Code's Markdown preview, Dark Modern / Light Modern |
| `vscode` | VS Code | the same, with the Dark+ / Light+ colours; every theme merges over this one |
Your own themes go in `~/.claude/md-preview/themes/<name>/theme.json`. A theme there with the same folder name as a built-in one is used in its place. It is still merged over the built-in `vscode`, like every theme. Choose a theme with `/md-preview theme <name>`.
## Merging
-Every key is optional. The template merges your `theme.json` over `vscode/theme.json`, so you only write what you change. A value of the wrong type (for example a colour that is not `#rgb`, `#rgba`, `#rrggbb` or `#rrggbbaa`, or text where a number belongs) is ignored, and the vscode value is used. The file must be valid JSON; if it is not, md-preview uses the default theme, `vscode-modern`, and tells you.
+Every key is optional. The template merges your `theme.json` over `vscode/theme.json`, so you only write what you change. A value of the wrong type (for example a colour that is not `#rgb`, `#rgba`, `#rrggbb` or `#rrggbbaa`, or text where a number belongs) is ignored, and the vscode value is used. The file must be valid JSON; if it is not, Intelligent UI uses the default theme, `claude-code`, and tells you.
Example: pink inline code, rounder boxes.
@@ -26,7 +27,7 @@ Example: pink inline code, rounder boxes.
## Units
-- `*-px`: CSS pixels of VS Code's preview. Its body text is 14px, so 1px = 11/14 pt (the body is always 11pt; md-preview scales the whole picture to your terminal).
+- `*-px`: CSS pixels of VS Code's preview. Its body text is 14px, so 1px = 11/14 pt (the body is always 11pt; Intelligent UI scales the whole picture to your terminal).
- `*-em`: em of that element's own text.
- `size`: a fraction of the body text size. For code, `"terminal"` means the size of your terminal's own text.
- Colours: `#rgb`, `#rgba`, `#rrggbb` or `#rrggbbaa`. The page is transparent, so a translucent background (for example `#ffffff1a`) looks right on any terminal colour.
@@ -40,7 +41,7 @@ Example: pink inline code, rounder boxes.
| `fonts.body` | SF Pro Text, Helvetica Neue, Helvetica, Arial, … | Body font list (first installed one wins, per character) |
| `fonts.code` | Menlo, SF Mono, DejaVu Sans Mono, … | Code font list |
| `fonts.use-terminal-font` | `true` | Put the terminal's own font first for code |
-| `dark.*`, `light.*` | see `vscode/theme.json` | Colours: `fg`, `muted`, `link`, `accent` (checked boxes), `bg` (the page colour that live Typst blocks get as `theme.bg`), `border` (h1/h2 rules, hr, table rows), `th-border`, `inline-code-fg`, `inline-code-bg`, `code-fg`, `code-bg`, `code-border`, `quote-bg`, `quote-border`, `check` (tick in a checked box), `red`, `green`, `blue`, `yellow`, `orange`, `purple` (for drawings) |
+| `dark.*`, `light.*` | see `vscode/theme.json` | Colours: `fg`, `muted`, `link`, `accent` (checked boxes), `bg` (the page colour that live Typst blocks get as `theme.bg`), `border` (h1/h2 rules, hr, table rows), `th-border`, `inline-code-fg`, `inline-code-bg`, `code-fg`, `code-plain-fg` (code blocks with no language; if you leave it out, `code-fg` is used), `code-bg`, `code-border`, `quote-bg`, `quote-border`, `check` (tick in a checked box), `red`, `green`, `blue`, `yellow`, `orange`, `purple` (for drawings) |
| `text.leading-em` / `text.paragraph-em` | `0.38` / `1.2` | Gap between lines / between paragraphs |
| `math-scale`, `math-inline-scale` | `1.2`, `1.1` | Size of display / inline LaTeX math, as a fraction of the text size. Live Typst blocks do not change. |
| `heading.size-em` | `[2, 1.5, 1.25, 1, 0.875, 0.85]` | h1–h6 sizes |
@@ -51,6 +52,7 @@ Example: pink inline code, rounder boxes.
| `list.indent-em`, `gap-em` | `1.9`, `0.55` | Bullet indent; gap from bullet to text |
| `list.number-indent-em`, `number-gap-em` | `1.45`, `0.5` | The same for numbered lists |
| `list.item-spacing-em` | `0.38` | Gap between items |
+| `list.numbering` | `"1."` | Numbers of numbered lists: a [Typst numbering pattern](https://typst.app/docs/reference/model/numbering/). Each counting symbol is one nesting level, and the last one repeats: `"1.a.i."` gives `1.`, `a.`, `i.`, `i.`. A pattern with no counting symbol is ignored. |
| `inline-code.size` | `1.0` | Code size (VS Code: same as body) |
| `inline-code.pad-x-px`, `pad-y-px`, `radius-px` | `3`, `1`, `4` | VS Code: `padding: 1px 3px; border-radius: 4px` |
| `code-block.size`, `line-height` | `1.0`, `1.357` | |
@@ -62,3 +64,5 @@ Example: pink inline code, rounder boxes.
## Licence
The `vscode` and `vscode-modern` values come from VS Code (MIT, Copyright (c) 2015 - present Microsoft Corporation). Each of those folders has the `LICENSE` file. Their `source` keys name the files the values come from.
+
+The `claude-code` colours come from Claude Code's theme palettes and its Markdown renderer. Claude Code writes links and code in ANSI colour names (`blue`, `cyan`, and so on), so the theme uses the ANSI colours of the VS Code terminal (`terminalColorRegistry.ts`, MIT) for them. Its syntax files keep the scopes of `vscode/*.tmTheme`. That folder has the `LICENSE` file too.
diff --git a/render/themes/claude-code/LICENSE b/render/themes/claude-code/LICENSE
new file mode 100644
index 0000000..0ac28ee
--- /dev/null
+++ b/render/themes/claude-code/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2015 - present Microsoft Corporation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/render/themes/claude-code/dark.tmTheme b/render/themes/claude-code/dark.tmTheme
new file mode 100644
index 0000000..fd5af9f
--- /dev/null
+++ b/render/themes/claude-code/dark.tmTheme
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!-- Claude Code's Markdown code colours: its highlight.js map of classes to
+ ANSI colour names, with the ANSI colours of VS Code's terminal
+ (dark; MIT, Copyright (c) 2015 - present Microsoft Corporation:
+ src/vs/workbench/contrib/terminal/common/terminalColorRegistry.ts).
+ The scopes come from ../vscode/dark.tmTheme. -->
+<plist version="1.0">
+<dict>
+ <key>name</key><string>Claude Code dark (hljs, ANSI)</string>
+ <key>settings</key>
+ <array>
+ <dict><key>settings</key><dict><key>foreground</key><string>#FFFFFF</string><key>background</key><string>#373737</string></dict></dict>
+ <dict><key>name</key><string>hljs-operator</string><key>scope</key><string>keyword.operator, storage.type.function.arrow, punctuation.separator.key-value, punctuation.separator, punctuation.accessor, punctuation.terminator, constant.language.import-export-all, keyword.operator.assignment</string><key>settings</key><dict><key>foreground</key><string>#FFFFFF</string></dict></dict>
+ <dict><key>name</key><string>hljs-keyword</string><key>scope</key><string>keyword, storage, storage.type, storage.modifier, keyword.control, keyword.declaration, keyword.other, keyword.operator.new, keyword.operator.expression, keyword.operator.word, keyword.operator.wordlike, keyword.operator.logical.python, keyword.operator.instanceof, keyword.operator.typeof, keyword.operator.sizeof, variable.language, support.type.primitive</string><key>settings</key><dict><key>foreground</key><string>#2472C8</string></dict></dict>
+ <dict><key>name</key><string>hljs-literal</string><key>scope</key><string>constant.language</string><key>settings</key><dict><key>foreground</key><string>#2472C8</string></dict></dict>
+ <dict><key>name</key><string>hljs-built_in</string><key>scope</key><string>support.function.builtin, support.class.builtin, support.type.builtin, support.function.builtin.shell, support.macro, variable.function.macro, support.class, support.constant.builtin, storage.type.rust, entity.name.namespace</string><key>settings</key><dict><key>foreground</key><string>#11A8CD</string></dict></dict>
+ <dict><key>name</key><string>hljs-type</string><key>scope</key><string>support.type, entity.name.type, storage.type.primitive, storage.type.numeric</string><key>settings</key><dict><key>foreground</key><string>#207B91</string></dict></dict>
+ <dict><key>name</key><string>hljs-number</string><key>scope</key><string>constant.numeric</string><key>settings</key><dict><key>foreground</key><string>#0DBC79</string></dict></dict>
+ <dict><key>name</key><string>hljs-string</string><key>scope</key><string>string, punctuation.definition.string, string punctuation.definition.string</string><key>settings</key><dict><key>foreground</key><string>#CD3131</string></dict></dict>
+ <dict><key>name</key><string>hljs-regexp</string><key>scope</key><string>string.regexp</string><key>settings</key><dict><key>foreground</key><string>#CD3131</string></dict></dict>
+ <dict><key>name</key><string>hljs-template_tag</string><key>scope</key><string>punctuation.definition.template-expression, punctuation.section.embedded</string><key>settings</key><dict><key>foreground</key><string>#FFFFFF</string></dict></dict>
+ <dict><key>name</key><string>hljs-subst</string><key>scope</key><string>meta.template.expression, meta.interpolation, source.python meta.interpolation</string><key>settings</key><dict><key>foreground</key><string>#FFFFFF</string></dict></dict>
+ <dict><key>name</key><string>hljs-title.function</string><key>scope</key><string>entity.name.function, variable.function, support.function, meta.function-call.generic</string><key>settings</key><dict><key>foreground</key><string>#E5E510</string></dict></dict>
+ <dict><key>name</key><string>hljs-title.class</string><key>scope</key><string>entity.name.class, entity.name.struct, entity.name.enum, entity.name.trait, entity.name.impl, entity.name.interface</string><key>settings</key><dict><key>foreground</key><string>#2472C8</string></dict></dict>
+ <dict><key>name</key><string>hljs-params</string><key>scope</key><string>variable.parameter</string><key>settings</key><dict><key>foreground</key><string>#FFFFFF</string></dict></dict>
+ <dict><key>name</key><string>hljs-comment</string><key>scope</key><string>comment, punctuation.definition.comment, comment punctuation.definition.comment</string><key>settings</key><dict><key>foreground</key><string>#0DBC79</string></dict></dict>
+ <dict><key>name</key><string>hljs-doctag</string><key>scope</key><string>comment.block.documentation storage.type, comment.block.documentation entity.name.tag, comment.block.documentation keyword, comment.line.documentation keyword</string><key>settings</key><dict><key>foreground</key><string>#0DBC79</string></dict></dict>
+ <dict><key>name</key><string>hljs-meta</string><key>scope</key><string>meta.preprocessor, entity.name.function.preprocessor, keyword.other.directive, meta.annotation, meta.decorator, entity.name.function.decorator, punctuation.definition.annotation, punctuation.definition.decorator, comment.line.shebang</string><key>settings</key><dict><key>foreground</key><string>#666666</string></dict></dict>
+ <dict><key>name</key><string>hljs-tag</string><key>scope</key><string>punctuation.definition.tag</string><key>settings</key><dict><key>foreground</key><string>#666666</string></dict></dict>
+ <dict><key>name</key><string>hljs-name</string><key>scope</key><string>entity.name.tag</string><key>settings</key><dict><key>foreground</key><string>#2472C8</string></dict></dict>
+ <dict><key>name</key><string>hljs-variable</string><key>scope</key><string>variable.other.readwrite.shell, variable.other.normal, variable.other.special, variable.other.positional, variable.other.bracket, punctuation.definition.variable, variable.other.php, variable.other.makefile</string><key>settings</key><dict><key>foreground</key><string>#FFFFFF</string></dict></dict>
+ <dict><key>name</key><string>hljs-attr</string><key>scope</key><string>meta.object-literal.key, meta.mapping.key string, meta.mapping.key, support.type.property-name.json, entity.name.tag.yaml, string.unquoted.key, entity.other.attribute-name, meta.structure.dictionary.key.python, meta.toml entity.name.tag, entity.name.tag.toml, meta.tag.toml</string><key>settings</key><dict><key>foreground</key><string>#11A8CD</string></dict></dict>
+ <dict><key>name</key><string>hljs-attribute</string><key>scope</key><string>support.type.property-name, meta.property-name</string><key>settings</key><dict><key>foreground</key><string>#FFFFFF</string></dict></dict>
+ <dict><key>name</key><string>hljs-symbol</string><key>scope</key><string>constant.other.symbol, constant.character.escape</string><key>settings</key><dict><key>foreground</key><string>#FFFFFF</string></dict></dict>
+ <dict><key>name</key><string>hljs-bullet</string><key>scope</key><string>punctuation.definition.list.begin.markdown, punctuation.definition.list, markup.list.unnumbered punctuation</string><key>settings</key><dict><key>foreground</key><string>#FFFFFF</string></dict></dict>
+ <dict><key>name</key><string>hljs-link</string><key>scope</key><string>markup.underline.link, string.other.link</string><key>settings</key><dict><key>fontStyle</key><string>underline</string></dict></dict>
+ <dict><key>name</key><string>hljs-section</string><key>scope</key><string>markup.heading, entity.name.section, punctuation.definition.heading</string><key>settings</key><dict><key>foreground</key><string>#FFFFFF</string></dict></dict>
+ <dict><key>name</key><string>hljs-selector</string><key>scope</key><string>entity.name.tag.css, entity.other.attribute-name.class.css, entity.other.attribute-name.id.css, entity.other.attribute-name.pseudo-class.css, entity.other.pseudo-class, meta.selector</string><key>settings</key><dict><key>foreground</key><string>#FFFFFF</string></dict></dict>
+ <dict><key>name</key><string>hljs-emphasis</string><key>scope</key><string>markup.italic</string><key>settings</key><dict><key>fontStyle</key><string>italic</string></dict></dict>
+ <dict><key>name</key><string>hljs-strong</string><key>scope</key><string>markup.bold</string><key>settings</key><dict><key>fontStyle</key><string>bold</string></dict></dict>
+ <dict><key>name</key><string>hljs-addition</string><key>scope</key><string>markup.inserted</string><key>settings</key><dict><key>foreground</key><string>#0DBC79</string></dict></dict>
+ <dict><key>name</key><string>hljs-deletion</string><key>scope</key><string>markup.deleted</string><key>settings</key><dict><key>foreground</key><string>#CD3131</string></dict></dict>
+ </array>
+</dict>
+</plist>
diff --git a/render/themes/claude-code/light.tmTheme b/render/themes/claude-code/light.tmTheme
new file mode 100644
index 0000000..cdd081c
--- /dev/null
+++ b/render/themes/claude-code/light.tmTheme
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!-- Claude Code's Markdown code colours: its highlight.js map of classes to
+ ANSI colour names, with the ANSI colours of VS Code's terminal
+ (light; MIT, Copyright (c) 2015 - present Microsoft Corporation:
+ src/vs/workbench/contrib/terminal/common/terminalColorRegistry.ts).
+ The scopes come from ../vscode/light.tmTheme. -->
+<plist version="1.0">
+<dict>
+ <key>name</key><string>Claude Code light (hljs, ANSI)</string>
+ <key>settings</key>
+ <array>
+ <dict><key>settings</key><dict><key>foreground</key><string>#000000</string><key>background</key><string>#F0F0F0</string></dict></dict>
+ <dict><key>name</key><string>hljs-operator</string><key>scope</key><string>keyword.operator, storage.type.function.arrow, punctuation.separator.key-value, punctuation.separator, punctuation.accessor, punctuation.terminator, constant.language.import-export-all, keyword.operator.assignment</string><key>settings</key><dict><key>foreground</key><string>#000000</string></dict></dict>
+ <dict><key>name</key><string>hljs-keyword</string><key>scope</key><string>keyword, storage, storage.type, storage.modifier, keyword.control, keyword.declaration, keyword.other, keyword.operator.new, keyword.operator.expression, keyword.operator.word, keyword.operator.wordlike, keyword.operator.logical.python, keyword.operator.instanceof, keyword.operator.typeof, keyword.operator.sizeof, variable.language, support.type.primitive</string><key>settings</key><dict><key>foreground</key><string>#0451A5</string></dict></dict>
+ <dict><key>name</key><string>hljs-literal</string><key>scope</key><string>constant.language</string><key>settings</key><dict><key>foreground</key><string>#0451A5</string></dict></dict>
+ <dict><key>name</key><string>hljs-built_in</string><key>scope</key><string>support.function.builtin, support.class.builtin, support.type.builtin, support.function.builtin.shell, support.macro, variable.function.macro, support.class, support.constant.builtin, storage.type.rust, entity.name.namespace</string><key>settings</key><dict><key>foreground</key><string>#0598BC</string></dict></dict>
+ <dict><key>name</key><string>hljs-type</string><key>scope</key><string>support.type, entity.name.type, storage.type.primitive, storage.type.numeric</string><key>settings</key><dict><key>foreground</key><string>#63BBD1</string></dict></dict>
+ <dict><key>name</key><string>hljs-number</string><key>scope</key><string>constant.numeric</string><key>settings</key><dict><key>foreground</key><string>#107C10</string></dict></dict>
+ <dict><key>name</key><string>hljs-string</string><key>scope</key><string>string, punctuation.definition.string, string punctuation.definition.string</string><key>settings</key><dict><key>foreground</key><string>#CD3131</string></dict></dict>
+ <dict><key>name</key><string>hljs-regexp</string><key>scope</key><string>string.regexp</string><key>settings</key><dict><key>foreground</key><string>#CD3131</string></dict></dict>
+ <dict><key>name</key><string>hljs-template_tag</string><key>scope</key><string>punctuation.definition.template-expression, punctuation.section.embedded</string><key>settings</key><dict><key>foreground</key><string>#000000</string></dict></dict>
+ <dict><key>name</key><string>hljs-subst</string><key>scope</key><string>meta.template.expression, meta.interpolation, source.python meta.interpolation</string><key>settings</key><dict><key>foreground</key><string>#000000</string></dict></dict>
+ <dict><key>name</key><string>hljs-title.function</string><key>scope</key><string>entity.name.function, variable.function, support.function, meta.function-call.generic</string><key>settings</key><dict><key>foreground</key><string>#949800</string></dict></dict>
+ <dict><key>name</key><string>hljs-title.class</string><key>scope</key><string>entity.name.class, entity.name.struct, entity.name.enum, entity.name.trait, entity.name.impl, entity.name.interface</string><key>settings</key><dict><key>foreground</key><string>#0451A5</string></dict></dict>
+ <dict><key>name</key><string>hljs-params</string><key>scope</key><string>variable.parameter</string><key>settings</key><dict><key>foreground</key><string>#000000</string></dict></dict>
+ <dict><key>name</key><string>hljs-comment</string><key>scope</key><string>comment, punctuation.definition.comment, comment punctuation.definition.comment</string><key>settings</key><dict><key>foreground</key><string>#107C10</string></dict></dict>
+ <dict><key>name</key><string>hljs-doctag</string><key>scope</key><string>comment.block.documentation storage.type, comment.block.documentation entity.name.tag, comment.block.documentation keyword, comment.line.documentation keyword</string><key>settings</key><dict><key>foreground</key><string>#107C10</string></dict></dict>
+ <dict><key>name</key><string>hljs-meta</string><key>scope</key><string>meta.preprocessor, entity.name.function.preprocessor, keyword.other.directive, meta.annotation, meta.decorator, entity.name.function.decorator, punctuation.definition.annotation, punctuation.definition.decorator, comment.line.shebang</string><key>settings</key><dict><key>foreground</key><string>#666666</string></dict></dict>
+ <dict><key>name</key><string>hljs-tag</string><key>scope</key><string>punctuation.definition.tag</string><key>settings</key><dict><key>foreground</key><string>#666666</string></dict></dict>
+ <dict><key>name</key><string>hljs-name</string><key>scope</key><string>entity.name.tag</string><key>settings</key><dict><key>foreground</key><string>#0451A5</string></dict></dict>
+ <dict><key>name</key><string>hljs-variable</string><key>scope</key><string>variable.other.readwrite.shell, variable.other.normal, variable.other.special, variable.other.positional, variable.other.bracket, punctuation.definition.variable, variable.other.php, variable.other.makefile</string><key>settings</key><dict><key>foreground</key><string>#000000</string></dict></dict>
+ <dict><key>name</key><string>hljs-attr</string><key>scope</key><string>meta.object-literal.key, meta.mapping.key string, meta.mapping.key, support.type.property-name.json, entity.name.tag.yaml, string.unquoted.key, entity.other.attribute-name, meta.structure.dictionary.key.python, meta.toml entity.name.tag, entity.name.tag.toml, meta.tag.toml</string><key>settings</key><dict><key>foreground</key><string>#0598BC</string></dict></dict>
+ <dict><key>name</key><string>hljs-attribute</string><key>scope</key><string>support.type.property-name, meta.property-name</string><key>settings</key><dict><key>foreground</key><string>#000000</string></dict></dict>
+ <dict><key>name</key><string>hljs-symbol</string><key>scope</key><string>constant.other.symbol, constant.character.escape</string><key>settings</key><dict><key>foreground</key><string>#000000</string></dict></dict>
+ <dict><key>name</key><string>hljs-bullet</string><key>scope</key><string>punctuation.definition.list.begin.markdown, punctuation.definition.list, markup.list.unnumbered punctuation</string><key>settings</key><dict><key>foreground</key><string>#000000</string></dict></dict>
+ <dict><key>name</key><string>hljs-link</string><key>scope</key><string>markup.underline.link, string.other.link</string><key>settings</key><dict><key>fontStyle</key><string>underline</string></dict></dict>
+ <dict><key>name</key><string>hljs-section</string><key>scope</key><string>markup.heading, entity.name.section, punctuation.definition.heading</string><key>settings</key><dict><key>foreground</key><string>#000000</string></dict></dict>
+ <dict><key>name</key><string>hljs-selector</string><key>scope</key><string>entity.name.tag.css, entity.other.attribute-name.class.css, entity.other.attribute-name.id.css, entity.other.attribute-name.pseudo-class.css, entity.other.pseudo-class, meta.selector</string><key>settings</key><dict><key>foreground</key><string>#000000</string></dict></dict>
+ <dict><key>name</key><string>hljs-emphasis</string><key>scope</key><string>markup.italic</string><key>settings</key><dict><key>fontStyle</key><string>italic</string></dict></dict>
+ <dict><key>name</key><string>hljs-strong</string><key>scope</key><string>markup.bold</string><key>settings</key><dict><key>fontStyle</key><string>bold</string></dict></dict>
+ <dict><key>name</key><string>hljs-addition</string><key>scope</key><string>markup.inserted</string><key>settings</key><dict><key>foreground</key><string>#107C10</string></dict></dict>
+ <dict><key>name</key><string>hljs-deletion</string><key>scope</key><string>markup.deleted</string><key>settings</key><dict><key>foreground</key><string>#CD3131</string></dict></dict>
+ </array>
+</dict>
+</plist>
diff --git a/render/themes/claude-code/theme.json b/render/themes/claude-code/theme.json
new file mode 100644
index 0000000..bb0a133
--- /dev/null
+++ b/render/themes/claude-code/theme.json
@@ -0,0 +1,68 @@
+{
+ "name": "Claude Code",
+ "description": "The colours of Claude Code's own Markdown in the terminal, with its dark and light themes",
+ "source": "Claude Code 2.1.302: its dark and light theme palettes (text, inactive, subtle, promptBorder, permission for inline code and code blocks with no language, claude for the accent, userMessageBackground for code blocks, the subagent colours for drawings) and its Markdown renderer (dim quote bar, no code background, underlined h1, '-' bullets, 1. a. i. 1. numbers, highlight.js classes as ANSI colours). ANSI colours (links, code) are VS Code's terminal colours, MIT, see LICENSE: src/vs/workbench/contrib/terminal/common/terminalColorRegistry.ts",
+ "syntax": { "dark": "dark.tmTheme", "light": "light.tmTheme" },
+ "dark": {
+ "fg": "#ffffff",
+ "muted": "#999999",
+ "link": "#3b8eea",
+ "accent": "#d77757",
+ "border": "#505050",
+ "th-border": "#888888",
+ "inline-code-fg": "#b1b9f9",
+ "inline-code-bg": "#00000000",
+ "code-fg": "#ffffff",
+ "code-plain-fg": "#b1b9f9",
+ "code-bg": "#373737",
+ "code-border": "#373737",
+ "quote-bg": "#00000000",
+ "quote-border": "#ffffff80",
+ "check": "#ffffff",
+ "red": "#dc2626",
+ "green": "#16a34a",
+ "blue": "#6a9bcc",
+ "yellow": "#ca8a04",
+ "orange": "#d97757",
+ "purple": "#827dbd"
+ },
+ "light": {
+ "fg": "#000000",
+ "muted": "#666666",
+ "link": "#0451a5",
+ "accent": "#d77757",
+ "border": "#afafaf",
+ "th-border": "#8a8a8a",
+ "inline-code-fg": "#5769f7",
+ "inline-code-bg": "#00000000",
+ "code-fg": "#000000",
+ "code-plain-fg": "#5769f7",
+ "code-bg": "#f0f0f0",
+ "code-border": "#f0f0f0",
+ "quote-bg": "#00000000",
+ "quote-border": "#00000080",
+ "check": "#ffffff",
+ "red": "#dc2626",
+ "green": "#16a34a",
+ "blue": "#6a9bcc",
+ "yellow": "#ca8a04",
+ "orange": "#d97757",
+ "purple": "#827dbd"
+ },
+ "heading": {
+ "rule-levels": 1
+ },
+ "list": {
+ "markers": ["-"],
+ "numbering": "1.a.i.1."
+ },
+ "inline-code": {
+ "pad-x-px": 0,
+ "pad-y-px": 0,
+ "radius-px": 0
+ },
+ "quote": {
+ "bar-px": 3,
+ "radius-px": 0
+ }
+}
diff --git a/render/themes/vscode/theme.json b/render/themes/vscode/theme.json
index eaf5b18..6e74835 100644
--- a/render/themes/vscode/theme.json
+++ b/render/themes/vscode/theme.json
@@ -78,6 +78,7 @@
"gap-em": 0.55,
"number-indent-em": 1.45,
"number-gap-em": 0.5,
+ "numbering": "1.",
"item-spacing-em": 0.38
},
"inline-code": {
diff --git a/tests/pure.test.ts b/tests/pure.test.ts
index aea75cc..2c6849f 100644
--- a/tests/pure.test.ts
+++ b/tests/pure.test.ts
@@ -475,7 +475,7 @@ test('a missing theme falls back to the default theme when it is there', () => {
themeEntry(BASE_THEME, `/mod/render/themes/${BASE_THEME}`, false, '{}'),
themeEntry(DEFAULT_THEME, `/mod/render/themes/${DEFAULT_THEME}`, false, '{}'),
])
- expect(DEFAULT_THEME).toBe('vscode-modern')
+ expect(DEFAULT_THEME).toBe('claude-code')
expect(chooseTheme(themes, 'gone', '/mod')).toEqual({ name: DEFAULT_THEME, dir: `/mod/render/themes/${DEFAULT_THEME}`, isFallback: true })
expect(chooseTheme(themes, DEFAULT_THEME, '/mod')).toMatchObject({ name: DEFAULT_THEME, isFallback: false })
expect(chooseTheme(themes, BASE_THEME, '/mod')).toMatchObject({ name: BASE_THEME, isFallback: false })
diff --git a/tests/themes.test.ts b/tests/themes.test.ts
index f86e033..99ebbfb 100644
--- a/tests/themes.test.ts
+++ b/tests/themes.test.ts
@@ -6,7 +6,8 @@ const HOME = '/fake-home'
const USER = `${HOME}/.claude/md-preview/themes`
const files: Record<string, string> = {
'render/themes/vscode/theme.json': '{"name":"VS Code","description":"built-in look"}',
- 'render/themes/vscode-modern/theme.json': '{"name":"VS Code Modern","description":"default look"}',
+ 'render/themes/vscode-modern/theme.json': '{"name":"VS Code Modern","description":"modern look"}',
+ 'render/themes/claude-code/theme.json': '{"name":"Claude Code","description":"default look"}',
'render/themes/nord/theme.json': '{"description":"built-in nord"}',
[`${USER}/nord/theme.json`]: '{"description":"my nord"}',
[`${USER}/Broken/theme.json`]: '{"name":',
@@ -47,7 +48,8 @@ const withThemes = (on: any, stored: Record<string, unknown> = {}) => {
test('/md-preview theme lists built-in and user themes; a user theme wins and a broken one is reported', async ($, on) => {
withThemes(on)
const ran = await $.command.run({ command: 'md-preview', args: 'theme' } as any)
- expect(ran.text).toContain('* vscode-modern (built-in): default look')
+ expect(ran.text).toContain('* claude-code (built-in): default look')
+ expect(ran.text).toContain('- vscode-modern (built-in): modern look')
expect(ran.text).toContain('- vscode (built-in): built-in look')
expect(ran.text).toContain('- nord (user): my nord')
expect(ran.text).toContain('- Sun.Light (user): bright')
@@ -72,7 +74,7 @@ test('/md-preview theme <name> switches and stores the name as typed; an unknown
expect(store['theme-name']).toBe('Sun.Light')
})
-test('a stored theme that is gone falls back to vscode-modern, with one toast', async ($, on) => {
+test('a stored theme that is gone falls back to claude-code, with one toast', async ($, on) => {
withThemes(on, { 'theme-name': 'gone' })
const toasts: string[] = []
on('ui.toast', async ($: any, e: any) => {
@@ -80,6 +82,6 @@ test('a stored theme that is gone falls back to vscode-modern, with one toast',
return { value: undefined }
})
const ran = await $.command.run({ command: 'md-preview', args: 'theme' } as any)
- expect(ran.text).toContain('* vscode-modern (built-in)')
- expect(toasts.filter(t => t.includes('md-preview: theme gone not found, using vscode-modern')).length).toBe(1)
+ expect(ran.text).toContain('* claude-code (built-in)')
+ expect(toasts.filter(t => t.includes('md-preview: theme gone not found, using claude-code')).length).toBe(1)
})