1 stable release

Uses new Rust 2024

new 1.0.0 Mar 8, 2025

#558 in Command line utilities

Download history 115/week @ 2025-03-05

115 downloads per month

MIT license

130KB
3.5K SLoC

Installation

First, setup Rust and Cargo according to the official instruction.

To use commands defined in justfile, install Just.

Usage

From the main directory of the project, compile and run the project via just run ARGS or just run-release ARGS. Replace ARGS with command line arguments for the program.

Example: just run examples/rect.svg should create an optimized examples/opt_rect.svg file.

You can pass -o flag to set the names of the output files, like so:

just run examples/rect.svg -o examples/rect2.svg

By default, all optimizations except lossy ones are enabled. To disable each of them, a flag is available, for example:

just run examples/rect.svg --no-shorten-ids

You can also disable all optimizations by default with -d and only enable a select few; for example:

just run examples/rect.svg -d --shorten-ids --remove-attribute-whitespace

Lossy optimizations need to be explicitly enabled. The flags to achieve this are --merge-transforms and --round-floats. Precision of the floating-point numbers that they output is controlled by the --precision flag; by default it is set to 3.

Description of each flag is available after running just run --help.

Dependencies

~10MB
~190K SLoC