Generate Syntax Highlighting CSS For Classed Based Output Of The syntect Crate In Rust

```cargo
[dependencies]
syntect = "5.2.0"
```

use syntect::highlighting::ThemeSet;
use syntect::html::ClassStyle;
use syntect::html::css_for_theme_with_class_style;


fn main() {
  let css = generate_css("Solarized (dark)");
  println!("{}", css);
}


fn generate_css(theme: &str) -> String {
  let ts = ThemeSet::load_defaults();
  if ts.themes.contains_key(theme) {
    let theme = &ts.themes[theme];
    match css_for_theme_with_class_style(theme, ClassStyle::Spaced) {
      Ok(css) => css,
      Err(_) => format!("/* could not load theme: {:?} */", theme)
    }
  } else  {
    format!("/* No theme available in syntect named: {:?} */", theme)
  }
}
TODO: Show Results Output

I like using classes instead of inline styles1 when doing syntax highlighting use syntect2 . This is the code I use to generate the style sheet that goes along with the highlighted code:

~ fin ~

Footnotes