From 04c2d5370bd36d463af31d1fc77653780498b6be Mon Sep 17 00:00:00 2001 From: Mica White Date: Sun, 7 Dec 2025 23:45:08 -0500 Subject: Support more languages and themes --- assets/newlines.packdump | Bin 0 -> 990354 bytes assets/nonewlines.packdump | Bin 0 -> 988904 bytes assets/themepack.themedump | Bin 0 -> 29219 bytes src/main.rs | 8 +++++--- 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 assets/newlines.packdump create mode 100644 assets/nonewlines.packdump create mode 100644 assets/themepack.themedump diff --git a/assets/newlines.packdump b/assets/newlines.packdump new file mode 100644 index 0000000..4eda2b9 Binary files /dev/null and b/assets/newlines.packdump differ diff --git a/assets/nonewlines.packdump b/assets/nonewlines.packdump new file mode 100644 index 0000000..ba1cf63 Binary files /dev/null and b/assets/nonewlines.packdump differ diff --git a/assets/themepack.themedump b/assets/themepack.themedump new file mode 100644 index 0000000..a3b7a87 Binary files /dev/null and b/assets/themepack.themedump differ diff --git a/src/main.rs b/src/main.rs index 50bc5a9..9cda2d6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,14 +1,16 @@ use std::io::Read; use std::path::PathBuf; +use syntect::dumps::{from_binary, from_uncompressed_data}; use syntect::highlighting::ThemeSet; use syntect::html::highlighted_html_for_string; use syntect::parsing::SyntaxSet; fn main() { - let syntax_set = SyntaxSet::load_defaults_newlines(); - let theme_set = ThemeSet::load_defaults(); - let mut theme = theme_set.themes["InspiredGitHub"].clone(); + let syntax_set: SyntaxSet = + from_uncompressed_data(include_bytes!("../assets/newlines.packdump")).unwrap(); + let theme_set = from_binary::(include_bytes!("../assets/themepack.themedump")); + let mut theme = theme_set.themes["Catppuccin Latte"].clone(); theme.settings.background = None; let filename = std::env::args().nth(1).map(PathBuf::from); -- cgit v1.2.3