diff options
| author | Mica White <botahamec@outlook.com> | 2025-12-07 23:45:08 -0500 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2025-12-07 23:45:08 -0500 |
| commit | 04c2d5370bd36d463af31d1fc77653780498b6be (patch) | |
| tree | 81b598adad2aa58e108f6979b31f37574f92646d | |
| parent | f15fc62034cab450dc8b6ccd39bfb49b6b205005 (diff) | |
Support more languages and themes
| -rw-r--r-- | assets/newlines.packdump | bin | 0 -> 990354 bytes | |||
| -rw-r--r-- | assets/nonewlines.packdump | bin | 0 -> 988904 bytes | |||
| -rw-r--r-- | assets/themepack.themedump | bin | 0 -> 29219 bytes | |||
| -rw-r--r-- | src/main.rs | 8 |
4 files changed, 5 insertions, 3 deletions
diff --git a/assets/newlines.packdump b/assets/newlines.packdump Binary files differnew file mode 100644 index 0000000..4eda2b9 --- /dev/null +++ b/assets/newlines.packdump diff --git a/assets/nonewlines.packdump b/assets/nonewlines.packdump Binary files differnew file mode 100644 index 0000000..ba1cf63 --- /dev/null +++ b/assets/nonewlines.packdump diff --git a/assets/themepack.themedump b/assets/themepack.themedump Binary files differnew file mode 100644 index 0000000..a3b7a87 --- /dev/null +++ b/assets/themepack.themedump 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::<ThemeSet>(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); |
