[][src]Function badgen::badge

pub fn badge(
    style: &Style<'_>,
    status: &str,
    label: Option<&str>
) -> Result<String, Error>

Generate an SVG badge given a style, status and optional label.

Uses the default font provided by this library.

Example

let badge = badgen::badge(
    &badgen::Style::classic(),
    "status",
    Some("label"),
).unwrap();

println!("{}", badge);