gen_icon_webp

command
v2.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Command gen_icon_webp rasterizes the SVG icon constants declared in internal/toolutil/icons.go into lossless WebP fallbacks for MCP clients that reject image/svg+xml (VS Code Copilot's mcpIcons.ts MIME allowlist, for example, admits image/webp but not SVG).

For every svg<Name> = `<svg ...>` constant it emits two 16x16 lossless WebP files under internal/toolutil/icons/webp/:

<name>-light.webp — near-black glyph (#1A1A1A), for Icon.Theme "light"
<name>-dark.webp  — near-white glyph (#FAFAFA), for Icon.Theme "dark"

It requires rsvg-convert (librsvg) and cwebp (libwebp) on PATH. This is a maintainer-only, occasional regeneration step: the generated .webp files are committed to the repository, so ordinary builds and CI never invoke this tool. Run it after adding or editing an icon in icons.go.

Usage:

go run ./cmd/gen_icon_webp/
go run ./cmd/gen_icon_webp/ --check

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL