{"id":23057553,"url":"https://github.com/bodoni/svg","last_synced_at":"2025-05-14T08:09:01.207Z","repository":{"id":27025522,"uuid":"30490162","full_name":"bodoni/svg","owner":"bodoni","description":"Composer and parser for SVG","archived":false,"fork":false,"pushed_at":"2025-01-09T16:54:29.000Z","size":338,"stargazers_count":316,"open_issues_count":10,"forks_count":45,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-15T01:54:24.929Z","etag":null,"topics":["composing","parsing","vector-graphics"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bodoni.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-08T12:19:39.000Z","updated_at":"2025-04-08T20:18:46.000Z","dependencies_parsed_at":"2024-06-18T18:37:55.082Z","dependency_job_id":"cc7d4282-1f54-4971-970a-c0ae23d878f6","html_url":"https://github.com/bodoni/svg","commit_stats":{"total_commits":307,"total_committers":17,"mean_commits":"18.058823529411764","dds":"0.12052117263843654","last_synced_commit":"8093556f7b770484ca5ff6795a6ef4bfb7b6db3a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodoni%2Fsvg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodoni%2Fsvg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodoni%2Fsvg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodoni%2Fsvg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bodoni","download_url":"https://codeload.github.com/bodoni/svg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254101558,"owners_count":22014908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composing","parsing","vector-graphics"],"created_at":"2024-12-16T02:12:59.896Z","updated_at":"2025-05-14T08:08:56.197Z","avatar_url":"https://github.com/bodoni.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SVG [![Package][package-img]][package-url] [![Documentation][documentation-img]][documentation-url] [![Build][build-img]][build-url]\n\nThe package provides an SVG composer and parser.\n\n## Example: Composing\n\n```rust\nuse svg::Document;\nuse svg::node::element::Path;\nuse svg::node::element::path::Data;\n\nlet data = Data::new()\n    .move_to((10, 10))\n    .line_by((0, 50))\n    .line_by((50, 0))\n    .line_by((0, -50))\n    .close();\n\nlet path = Path::new()\n    .set(\"fill\", \"none\")\n    .set(\"stroke\", \"black\")\n    .set(\"stroke-width\", 3)\n    .set(\"d\", data);\n\nlet document = Document::new()\n    .set(\"viewBox\", (0, 0, 70, 70))\n    .add(path);\n\nsvg::save(\"image.svg\", \u0026document).unwrap();\n```\n\n## Example: Parsing\n\n```rust\nuse svg::node::element::path::{Command, Data};\nuse svg::node::element::tag::Path;\nuse svg::parser::Event;\n\nlet path = \"image.svg\";\nlet mut content = String::new();\nfor event in svg::open(path, \u0026mut content).unwrap() {\n    match event {\n        Event::Tag(Path, _, attributes) =\u003e {\n            let data = attributes.get(\"d\").unwrap();\n            let data = Data::parse(data).unwrap();\n            for command in data.iter() {\n                match command {\n                    \u0026Command::Move(..) =\u003e { /* … */ },\n                    \u0026Command::Line(..) =\u003e { /* … */ },\n                    _ =\u003e {}\n                }\n            }\n        }\n        _ =\u003e {}\n    }\n}\n```\n\n## Contribution\n\nYour contribution is highly appreciated. Do not hesitate to open an issue or a\npull request. Note that any contribution submitted for inclusion in the project\nwill be licensed according to the terms given in [LICENSE.md](LICENSE.md).\n\n[build-img]: https://github.com/bodoni/svg/workflows/build/badge.svg\n[build-url]: https://github.com/bodoni/svg/actions/workflows/build.yml\n[documentation-img]: https://docs.rs/svg/badge.svg\n[documentation-url]: https://docs.rs/svg\n[package-img]: https://img.shields.io/crates/v/svg.svg\n[package-url]: https://crates.io/crates/svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodoni%2Fsvg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbodoni%2Fsvg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodoni%2Fsvg/lists"}