Skip to content

carbonable-labs/svgenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🗃️ 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.