From 59903d81b6cb0ff241a88a25d81ebd3b0c130399 Mon Sep 17 00:00:00 2001 From: drisspg Date: Thu, 16 May 2024 10:43:03 -0700 Subject: [PATCH] update styling --- src/parsers.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/parsers.rs b/src/parsers.rs index cb996c5..05315ee 100644 --- a/src/parsers.rs +++ b/src/parsers.rs @@ -215,7 +215,7 @@ impl StructuredLogParser for InductorOutputCodeParser { // Generate HTML output and handle potential errors let html_payload = match generate_html_output(payload) { Ok(html) => html, - Err(_e) => return Err(anyhow::anyhow!("Failed to parse html")), + Err(_e) => return Err(anyhow::anyhow!("Failed to parse inductor code to html")), }; simple_file_output( &filename.to_string_lossy(), @@ -229,7 +229,7 @@ impl StructuredLogParser for InductorOutputCodeParser { } } -fn generate_html_output(payload: &str) -> Result { +fn generate_html_output(payload: &str) -> Result { let syntax_set = SyntaxSet::load_defaults_newlines(); let theme_set = ThemeSet::load_defaults(); let syntax = syntax_set.find_syntax_by_extension("py").unwrap(); @@ -237,9 +237,13 @@ fn generate_html_output(payload: &str) -> Result { &payload, &syntax_set, &syntax, - &theme_set.themes["base16-ocean.dark"], + &theme_set.themes["InspiredGitHub"], ); - html + let wrapped_html = format!( + "
{}
", + html.unwrap() + ); + Ok(wrapped_html) } pub struct OptimizeDdpSplitChildParser;