siteone-crawler 2.3.0

Website crawler and QA toolkit in Rust for security, performance, SEO, and accessibility audits, offline cloning, markdown export, sitemap generation, cache warming, and CI/CD gating — one dependency-free binary for all major platforms, 10 tools in one.
Documentation
// SiteOne Crawler - Badge for HTML Report
// (c) Jan Reges <jan.reges@siteone.cz>

/// Badge colors used in HTML report tabs and content
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum BadgeColor {
    Red,
    Orange,
    Green,
    Blue,
    Neutral,
}

impl BadgeColor {
    pub fn as_css_class(&self) -> &'static str {
        match self {
            BadgeColor::Red => "red",
            BadgeColor::Orange => "orange",
            BadgeColor::Green => "green",
            BadgeColor::Blue => "blue",
            BadgeColor::Neutral => "neutral",
        }
    }
}

/// Badge displayed in tab titles or content to show counts/status
#[derive(Debug, Clone)]
pub struct Badge {
    pub value: String,
    pub color: BadgeColor,
    pub title: Option<String>,
}

impl Badge {
    pub fn new(value: String, color: BadgeColor) -> Self {
        Self {
            value,
            color,
            title: None,
        }
    }

    pub fn with_title(value: String, color: BadgeColor, title: &str) -> Self {
        Self {
            value,
            color,
            title: Some(title.to_string()),
        }
    }
}