Skip to content

Commit 5330ded

Browse files
committed
Update
1 parent 266fa52 commit 5330ded

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

Cargo.lock

Lines changed: 10 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ unicode-segmentation = "1.2"
116116
url = "2"
117117
walkdir = "2"
118118
webp = "0.3"
119-
giallo = {path = "../giallo", features = ["dump"]}
119+
giallo = {version = "0.1", features = ["dump"]}
120120

121121
# Internal crates
122122
config = { path = "components/config" }

components/config/src/config/markup.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use giallo::{HighlightOptions, Registry};
1+
use giallo::{HighlightOptions, Registry, ThemeVariant};
22
use serde::{Deserialize, Serialize};
33
use std::path::Path;
44

@@ -114,16 +114,15 @@ impl Highlighting {
114114
}
115115

116116
pub fn highlight_options<'a>(&'a self, lang: &'a str) -> HighlightOptions<'a> {
117-
let mut opt = HighlightOptions::new(lang);
118-
119-
match &self.theme {
117+
let mut opt = match &self.theme {
120118
HighlightConfig::Single { theme } => {
121-
opt = opt.single_theme(theme);
122-
}
123-
HighlightConfig::Dual { light_theme, dark_theme } => {
124-
opt = opt.light_dark_themes(light_theme, dark_theme);
119+
HighlightOptions::new(lang, ThemeVariant::Single(theme))
125120
}
126-
}
121+
HighlightConfig::Dual { light_theme, dark_theme } => HighlightOptions::new(
122+
lang,
123+
ThemeVariant::Dual { light: light_theme, dark: dark_theme },
124+
),
125+
};
127126

128127
if !self.error_on_missing_language {
129128
opt = opt.fallback_to_plain(true);

0 commit comments

Comments
 (0)