Skip to content

v0.4.0 — Animated demos go light and dark

Latest

Choose a tag to compare

@github-actions github-actions released this 06 Jul 19:09

The dual-theme trick from v0.3.0 — one SVG carrying a light and a dark palette, switched by the viewer's prefers-color-scheme — now works for animated recordings too. One set of frames serves both palettes, so the dual file below costs 22 bytes more than its single-theme twin. If you're reading this in GitHub's dark mode it's already dark; flip your theme and it follows.

Animated dual-theme demo

Highlights

  • Animated dual-theme--theme-light github-light --theme-dark github-dark now works for .cast inputs and rec sessions, not just stills. Frames are rendered once with palette classes and the colours live in a CSS block per theme, so a dual animation is ~100% the size of a single-theme one instead of double.
  • asciicast v3 — recordings from asciinema 3.0 load directly (v2 keeps working). v3 files embed the recording terminal's colours, so -t auto renders a session with the palette of the terminal it was recorded in.
  • Trim the replay--from 12 --to 31 animates just a slice of a recording. The first frame opens on the screen as of --from, so the lead-in is skipped, not fast-forwarded.
  • Cursor styles and reduced motion--cursor <block|bar|underline|none> picks the cursor shape, and every animated SVG now respects prefers-reduced-motion by showing the final frame as a still poster.
  • Completions, man page, config fileterminal-svg --completions zsh (and bash/fish/elvish/powershell), a generated man page, and personal defaults in ~/.config/terminal-svg/config.toml — flags always beat the config, and typo'd keys fail loudly instead of silently doing nothing.
  • A --help worth reading — flags are grouped into the same sections as the docs (Output & themes, Window, Layout & fonts, Capture, Animation) with human value names and a set of examples at the bottom.

Existing invocations all keep working. Rendered output is unchanged apart from animated SVGs gaining the reduced-motion CSS block.

Install

brew install russmckendrick/tap/terminal-svg   # or: brew upgrade terminal-svg

Or grab a binary below (macOS arm64/amd64, Linux arm64/amd64, Windows amd64 — each with a SHA-256 checksum). rec is macOS/Linux only for now; rendering .cast files works everywhere.

Quick start

# an animated README demo that follows the viewer's light/dark mode
terminal-svg demo.cast --theme-light github-light --theme-dark github-dark

# render an asciinema 3 recording with its own terminal's colours
terminal-svg session.cast -t auto

# animate just the good bit
terminal-svg demo.cast --from 12 --to 31 -o highlight.svg

Docs: README · CLI reference · theme format · how it works

Bundled JetBrainsMono Nerd Font faces are under the SIL OFL; the code is MIT.

Full Changelog: v0.3.0...v0.4.0