Expand description
Rust badge renderer targeting Shields-compatible badge output.
Start with BadgeOptions::new and render with make_badge.
use badge_maker_rs::{BadgeOptions, Color, Style, make_badge};
let svg = make_badge(
&BadgeOptions::new("passing")
.label("build")
.color("brightgreen".parse::<Color>().unwrap())
.style(Style::Flat)
.build(),
)
.unwrap();
assert!(svg.starts_with("<svg "));
assert!(svg.contains("aria-label=\"build: passing\""));The public API is intentionally Rust-first. The compatibility target is the final rendered badge image: pixel-equivalent output matters more than SVG source parity, and JavaScript-specific API shape is out of scope.
Structs§
- Badge
Options - Badge rendering options.
- Badge
Options Builder - Use builder syntax to set the inputs and finish with
build(). - Parse
Color Error - Failed to parse a color string into
Color.
Enums§
- Color
- Strongly-typed badge color input.
- Error
- Rendering errors returned by
make_badge. - Named
Color - Documented Shields named colors and semantic aliases.
- Style
- Badge visual style. Visual style used for badge rendering.
Functions§
- make_
badge - Renders a complete SVG badge document from
BadgeOptions.