+4
-4
| { | ||
| "name": "kittyhtml", | ||
| "version": "0.3.1", | ||
| "version": "0.3.2", | ||
| "description": "Render HTML to an image and display it inline in Kitty/iTerm2-capable terminals. No browser — Rust + Blitz layout, headless CPU rasterization.", | ||
@@ -28,5 +28,5 @@ "type": "module", | ||
| "optionalDependencies": { | ||
| "kittyhtml-darwin-arm64": "0.3.1", | ||
| "kittyhtml-darwin-x64": "0.3.1", | ||
| "kittyhtml-linux-x64-gnu": "0.3.1" | ||
| "kittyhtml-darwin-arm64": "0.3.2", | ||
| "kittyhtml-darwin-x64": "0.3.2", | ||
| "kittyhtml-linux-x64-gnu": "0.3.2" | ||
| }, | ||
@@ -33,0 +33,0 @@ "scripts": { |
+14
-2
@@ -19,3 +19,4 @@ #!/usr/bin/env node | ||
| --height N Fixed canvas height; omit to auto-fit content. | ||
| --scale N Pixel ratio for crisper output (default 1; try 2). | ||
| --scale N Pixel ratio for crisper output (default: 2 when piping | ||
| to a graphics-capable terminal, 1 when writing to file). | ||
| --background CSS Fill canvas background before painting (e.g. "#fff"). | ||
@@ -50,3 +51,4 @@ --format FMT Output protocol: auto | kitty | iterm2 (default auto). | ||
| height: null, | ||
| scale: 1, | ||
| // null sentinel: filled in after arg parse based on output destination. | ||
| scale: null, | ||
| background: null, | ||
@@ -91,2 +93,12 @@ format: 'auto', | ||
| if (positional[0]) opts.file = positional[0]; | ||
| if (opts.scale == null) { | ||
| // Going to a graphics-capable terminal → assume HiDPI (every modern | ||
| // mac and most linux laptops). The terminal will downscale the larger | ||
| // PNG to fill the same on-screen area, giving retina-sharp text. File | ||
| // output stays at 1:1 since the user knows they want the literal pixel | ||
| // count they asked for. | ||
| opts.scale = opts.out == null && process.stdout.isTTY ? 2 : 1; | ||
| } | ||
| return opts; | ||
@@ -93,0 +105,0 @@ } |
411160
0.14%284
3.65%