Start work on theme printer

This commit is contained in:
Marshall Bowers 2023-11-02 18:57:13 -04:00
parent 0bc51382b2
commit fc376287e0
2 changed files with 278 additions and 8 deletions

View file

@ -1,3 +1,6 @@
mod theme_printer;
mod vscode;
use std::fs::{self, File};
use std::path::PathBuf;
use std::str::FromStr;
@ -7,16 +10,12 @@ use gpui::serde_json;
use log::LevelFilter;
use serde::Deserialize;
use simplelog::SimpleLogger;
use theme::{
default_color_scales, Appearance, GitStatusColors, PlayerColors, StatusColors, SyntaxTheme,
SystemColors, ThemeColors, ThemeFamily, ThemeStyles, ThemeVariant,
};
use theme::{default_color_scales, Appearance, ThemeFamily};
use vscode::VsCodeThemeConverter;
use crate::theme_printer::ThemeFamilyPrinter;
use crate::vscode::VsCodeTheme;
mod vscode;
pub(crate) fn new_theme_family(name: String, author: String) -> ThemeFamily {
ThemeFamily {
id: uuid::Uuid::new_v4().to_string(),
@ -36,7 +35,7 @@ struct FamilyMetadata {
#[derive(Debug, Deserialize)]
#[serde(rename_all = "snake_case")]
enum ThemeAppearanceJson {
pub enum ThemeAppearanceJson {
Light,
Dark,
}
@ -51,7 +50,7 @@ impl From<ThemeAppearanceJson> for Appearance {
}
#[derive(Debug, Deserialize)]
struct ThemeMetadata {
pub struct ThemeMetadata {
pub name: String,
pub file_name: String,
pub appearance: ThemeAppearanceJson,
@ -117,5 +116,9 @@ fn main() -> Result<()> {
theme_families.push(theme_family);
}
for theme_family in theme_families {
println!("{:#?}", ThemeFamilyPrinter::new(theme_family));
}
Ok(())
}