{"id":15394889,"url":"https://github.com/cgbur/badge-maker","last_synced_at":"2025-10-29T15:26:02.338Z","repository":{"id":36979376,"uuid":"327998820","full_name":"cgbur/badge-maker","owner":"cgbur","description":"Rust badge maker","archived":false,"fork":false,"pushed_at":"2022-06-21T04:21:00.000Z","size":879,"stargazers_count":48,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T06:16:19.695Z","etag":null,"topics":["badge","badge-generator","badges","maker","shields"],"latest_commit_sha":null,"homepage":"https://github.com/cgbur/badge-maker","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cgbur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-08T19:53:50.000Z","updated_at":"2025-03-27T07:16:03.000Z","dependencies_parsed_at":"2022-07-11T12:29:42.174Z","dependency_job_id":null,"html_url":"https://github.com/cgbur/badge-maker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgbur%2Fbadge-maker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgbur%2Fbadge-maker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgbur%2Fbadge-maker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgbur%2Fbadge-maker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cgbur","download_url":"https://codeload.github.com/cgbur/badge-maker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248855958,"owners_count":21172673,"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":["badge","badge-generator","badges","maker","shields"],"created_at":"2024-10-01T15:24:49.465Z","updated_at":"2025-10-29T15:25:57.306Z","avatar_url":"https://github.com/cgbur.png","language":"Rust","readme":" # Badge-Maker\n[![Crates.io][crates-badge]][crates-url]\n[![MIT licensed][mit-badge]][mit-url]\n\n[crates-badge]: https://img.shields.io/crates/v/badge-maker.svg\n[crates-url]: https://crates.io/crates/badge-maker\n[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg\n[mit-url]: https://github.com/cgbur/badge-maker/blob/master/LICENSE\n\n_Links are generated from cargo, view on [docs](https://docs.rs/badge-maker/0.1.1/badge_maker/) page_\n\n\n A fast and accurate badge maker for services like [shields.io](https://shields.io/). Verified to\n match [badge-maker](https://www.npmjs.com/package/badge-maker) 1-to-1 with side by rendering tests*.\n\n ![example_flat][flat]\n\n ![example_plastic][plastic]\n\n ![example_flat_square][flatsquare]\n\n ![example_badge_maker][badge_maker]\n\n ![example_color][example_color]\n\n ![example_badge][example_badge]\n\n [flat]: https://raw.githubusercontent.com/cgbur/badge-maker/master/doc_svgs/example_flat.svg\n [plastic]: https://raw.githubusercontent.com/cgbur/badge-maker/master/doc_svgs/example_plastic.svg\n [flatsquare]: https://raw.githubusercontent.com/cgbur/badge-maker/master/doc_svgs/example_flatsquare.svg\n [badge_maker]: https://raw.githubusercontent.com/cgbur/badge-maker/master/doc_svgs/example_badge_maker.svg\n [example_color]: https://raw.githubusercontent.com/cgbur/badge-maker/master/doc_svgs/example_color.svg\n [example_badge]: https://raw.githubusercontent.com/cgbur/badge-maker/master/doc_svgs/example_badge.svg\n [example_cli]: https://raw.githubusercontent.com/cgbur/badge-maker/master/doc_svgs/example_cli.svg\n [link_logo]: https://raw.githubusercontent.com/cgbur/badge-maker/master/doc_svgs/example_link_logo.svg\n*_This library differs in that it generates unique IDs for the svg so it can be directly\n  embedded in websites (such as in this doc). So a diff between the outputs will not match. We\n only claim the visual outputs match which is whats important._\n\n ## About\n\n This library is meant to be the Rust version of\n [badge-maker](https://www.npmjs.com/package/badge-maker).\n The use cases for this library are two-fold:\n  * **Rusty** badge maker for any rust-based [shields.io](https://shields.io/) clones\n  * **WASM** based npm package for a speed increase over the node based version (numbers coming when\n optimizations are finished)\n\n **Current todos**\n  1. Better code coverage\n  2. Optimize text formatters\n  3. Fix errors. The output is ugly.\n  4. Other badge styles (requires a custom renderer)\n\n ### Example\n![example_badge_maker][badge_maker]\n ```rust\n use badge_maker::BadgeBuilder;\n\n let svg = BadgeBuilder::new()\n       .label(\"badge\")\n       .message(\"maker\")\n       .color_parse(\"#33B5E5\")\n       .build()?\n       .svg();\n\n println!(\"{}\", svg);\n\n # Ok::\u003c(), badge_maker::error::Error\u003e(())\n ```\n\n ## Features\n \u003e This library is still in its infancy. Tests and documentation are being added whenever\n possible. If you are interested in contributing then check out the [repository](https://github.com/cgbur/badge-maker).\n The API is likely to change. If you see something you think would work better than\n the way I've done it open an issue, I'd love to hear your suggestions.\n\n We support different [styles](Style), [colors](color::Color), [logos](Logo), and [links](Links). The\n [badge builder](BadgeBuilder) accepts all of these options with the `field()` and an\n alternate method of `field_parse()` which accepts a string and will attempt parse the text as\n a valid field.\n\n #### CLI\n\n This is a library but you can use it with a simple cli tool as well.\n\n ![cli][example_cli]\n\n install\n ```bash\n cargo install badge-maker --features cli\n ```\n use\n ```bash\n badge-maker example badge -c informational -l #282828 -s flat\n ```\n on windows the `#` needs to be handled specially\n ```bash\n badge-maker example badge -c informational -l \"#282828\" -s flat\n ```\n\n\n ### [Colors](Color)\n\n We currently support hex colors 3 and 6 chars long, [named colors](color::NamedColor)\n and their [alias's](color::AliasColor), and [RGB](color::Color::Rgb) color inputs. These can be constructed\n with their enum variants or using the `...parse()` methods.\n\n![example_color][example_color]\n\n ```rust\n use badge_maker::BadgeBuilder;\n use badge_maker::color::{Color, AliasColor, NamedColor};\n\n let svg = BadgeBuilder::new()\n     .label(\"color\")\n     .message(\"example\")\n     // by enums\n     .color(Color::Named(NamedColor::BrightGreen))\n     .color(Color::Alias(AliasColor::Success))\n     .color(Color::Rgb(10, 200, 50))\n     // or parsing\n     .color_parse(\"brightgreen\")\n     .color_parse(\"success\")\n     .color_parse(\"rgb(10, 200, 50)\")\n     .build()?\n     .svg();\n\n # Ok::\u003c(), badge_maker::error::Error\u003e(())\n ```\n\n\n ### [Styles](Style)\n **Supported**. Others coming soon. See [Style](Style) enum for choices when\n building or use the string literals.\n\n  - **Flat** ![example_flat][flat]\n  - **Plastic** ![example_plastic][plastic]\n  - **FlatSquare** ![example_flat_square][flatsquare]\n  - ForTheBadge\n  - Social\n\n ```rust\n use badge_maker::{BadgeBuilder, Style};\n\n let svg = BadgeBuilder::new()\n   .label(\"example\")\n   .message(\"plastic\")\n   .color_parse(\"#FFB932\")\n   .style(Style::Plastic) // example of using typed input\n   .style_parse(\"plastic\") // example of parsing to derive\n   .build()?\n   .svg();\n\n println!(\"{}\", svg);\n\n # Ok::\u003c(), badge_maker::error::Error\u003e(())\n ```\n\n ### [Links](Links) \u0026 [Logos](Logo)\n Adding links to the natively rendered badge supported. This is great if you need\n to embed the svg directly. However, on a website like the rust docs they may show\n the underline. To solve this, your third-party api that renders the badges should\n wrap the svg in markdown `[![name for readers](link to api endpoint)](link when clicked)`.\n\n\n![example_link_logo][link_logo]\n ```rust\n use badge_maker::BadgeBuilder;\n\n let logo_url = \"https://upload.wikimedia.org/wikipedia/commons/\\\n   thumb/d/d5/Rust_programming_language_black_logo.svg/\\\n   1024px-Rust_programming_language_black_logo.svg.png\";\n\n let svg = BadgeBuilder::new()\n   .label(\"lang\")\n   .message(\"rust\")\n   .color_parse(\"#F5F5F5\")\n   .link(\"https://www.rust-lang.org/\")\n   .logo_url(logo_url)\n   .style_parse(\"flatsquare\")\n   .build()?\n   .svg();\n\n # Ok::\u003c(), badge_maker::error::Error\u003e(())\n ```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgbur%2Fbadge-maker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcgbur%2Fbadge-maker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgbur%2Fbadge-maker/lists"}