pub mod bat;
pub mod css;
pub mod md3;
pub mod fleet_fonts;
pub mod ghostty;
pub mod glsl;
pub mod json;
pub mod nix;
pub mod nix_ast;
pub mod rust;
pub mod scss;
pub mod stylix;
pub mod stylix_fonts;
pub mod svg;
pub mod tailwind;
pub mod tui;
pub mod vellum;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Target {
Css,
Md3,
Tailwind,
Scss,
Rust,
Json,
Glsl,
Ghostty,
Tui,
Svg,
Stylix,
Bat,
Nix,
StylixFonts,
FleetFonts,
StylixVellum,
StylixVellumBase24,
SvgVellumPalette,
SkimVellum,
EscribaVellum,
}
impl Target {
pub fn from_str(s: &str) -> Option<Self> {
Some(match s {
"css" => Self::Css,
"md3" | "material" | "md-sys-color" => Self::Md3,
"tailwind" => Self::Tailwind,
"scss" => Self::Scss,
"rust" => Self::Rust,
"json" => Self::Json,
"glsl" => Self::Glsl,
"ghostty" => Self::Ghostty,
"tui" => Self::Tui,
"svg" => Self::Svg,
"stylix" | "stylix-base16" => Self::Stylix,
"bat" | "bat-tmtheme" => Self::Bat,
"stylix-fonts" | "fonts-nix" => Self::StylixFonts,
"nix" | "nord-palette-nix" => Self::Nix,
"fleet-fonts" | "fleet_fonts" => Self::FleetFonts,
"stylix-vellum" | "stylix-base16-vellum" => Self::StylixVellum,
"stylix-vellum-base24" | "stylix-base24-vellum" => Self::StylixVellumBase24,
"svg-vellum-palette" | "vellum-palette" => Self::SvgVellumPalette,
"skim-vellum" | "skim" => Self::SkimVellum,
"escriba-vellum" | "escriba" => Self::EscribaVellum,
_ => return None,
})
}
pub fn render(&self, tokens: &ishou_tokens::TokenSet) -> String {
match self {
Self::Css => css::render(tokens),
Self::Md3 => md3::render(tokens),
Self::Tailwind => tailwind::render(tokens),
Self::Scss => scss::render(tokens),
Self::Rust => rust::render(tokens),
Self::Json => json::render(tokens),
Self::Glsl => glsl::render(tokens),
Self::Ghostty => ghostty::render(tokens),
Self::Tui => tui::render(tokens),
Self::Svg => svg::render(tokens),
Self::Stylix => stylix::render(tokens),
Self::Bat => bat::render(tokens),
Self::Nix => nix::render(tokens),
Self::StylixFonts => stylix_fonts::render(tokens),
Self::FleetFonts => fleet_fonts::render(tokens),
Self::StylixVellum => vellum::render_base16(),
Self::StylixVellumBase24 => vellum::render_base24(),
Self::SvgVellumPalette => vellum::render_svg_palette(),
Self::SkimVellum => vellum::render_skim(),
Self::EscribaVellum => vellum::render_escriba_lisp(),
}
}
pub fn all() -> [Target; 20] {
[
Self::Css,
Self::Md3,
Self::Tailwind,
Self::Scss,
Self::Rust,
Self::Json,
Self::Glsl,
Self::Ghostty,
Self::Tui,
Self::Svg,
Self::Stylix,
Self::Bat,
Self::Nix,
Self::StylixFonts,
Self::FleetFonts,
Self::StylixVellum,
Self::StylixVellumBase24,
Self::SvgVellumPalette,
Self::SkimVellum,
Self::EscribaVellum,
]
}
}