svg2png

command
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command svg2png rasterizes one or more standalone metrics SVG files to PNG using the same chromedp-based renderer the production pipeline uses (internal/render.Browser + Resize). Two uses:

  • Developer aid for visual layout comparison between the Go output (docs/examples/) and the upstream reference output (docs/org_examples/) — both rendered through the identical Chrome path so any difference is a real layout difference, not a renderer artifact.
  • The doc-sample regen pipeline (regen-doc-samples.yml / scripts/gen-doc-samples.sh) derives each sample's PNG from its already-rendered SVG with zero API calls, instead of running a second full API fetch (#527). For that reason the production image ships this binary next to metrics-cli (see Dockerfile).

Usage:

METRICS_CHROME_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
  go run ./internal/tools/svg2png --out /tmp/png a.svg b.svg ...

It has no bearing on the action / CLI binaries' contract.

Jump to

Keyboard shortcuts

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