vexy-vsvg-plugin-sdk
This crate contains the tools to build your own SVG optimization plugins, plus the implementation of the standard 52 plugins ported from SVGO.
If you want to manipulate the SVG AST, you do it here.
How it works
Plugins implement the Plugin trait and use a Visitor to traverse the DOM.
Writing a Plugin
You don't manually crawl the tree. You define a Visitor that hooks into specific events, like entering an element.
use ;
use Result;
;
;
Components
plugins: The collection of built-in plugins (removeComments,convertPathData, etc.).registry: A central lookup to create plugins by name.selector: A CSS selector engine, because sometimes you need to find allpath.icon.css_matching: Logic to check if an element matches a selector.