Skip to content

Latest commit

 

History

History
56 lines (36 loc) · 1.07 KB

README.md

File metadata and controls

56 lines (36 loc) · 1.07 KB

🗃️ SVGenerator

✨ SVG to Cairo Code Converter

⚡ About SVGenerator ⚡

SVGenerator is a tool to convert SVG files to Cairo code that outputs the SVG file. SVG groups <g id="group1"> .. </g> will produce a specific Cairo function

fn print_group1(ref svg, data: @Data) { .. }

The SVG can be annotated with @@var_name@@ to allow data to be added dynamically in Cairo.

🛠️ Build

To build the project, run:

cargo build

Usage

Generate

To convert a (annotated) SVG file to Cairo:

cargo run --generate path/to/yourfile.svg

To escape quotation marks ".."

cargo run -- generate path/to/yourfile.svg --escaped
cargo run -- generate path/to/yourfile.svg -e

Groups

To visualize the SVG grouping structure:

cargo run -- groups path/to/yourfile.svg

📖 License

This project is licensed under the APACHE 2 license. See LICENSE for more information.