added css style reference to hayabusa_report.css in html report #689

This commit is contained in:
DastInDark
2022-09-27 15:08:34 +09:00
parent 0058334e60
commit 9e56eb6481
4 changed files with 24 additions and 1 deletions

View File

@@ -8,3 +8,5 @@ pub mod timeline;
pub mod yaml;
#[macro_use]
extern crate prettytable;
#[macro_use]
extern crate horrorshow;

View File

@@ -8,6 +8,8 @@ use std::io::BufWriter;
use std::io::Write;
use std::path::Path;
use std::sync::RwLock;
use horrorshow::prelude::*;
use horrorshow::helper::doctype;
lazy_static! {
pub static ref HTML_REPORTER: RwLock<HtmlReporter> = RwLock::new(HtmlReporter::new());
@@ -103,7 +105,18 @@ pub fn create_html_file(input_html: String, path_str: String) {
return;
}
let mut html_writer = BufWriter::new(File::create(path).unwrap());
writeln!(html_writer, "{}", input_html).ok();
let html_data = format!("{}", html! {
: doctype::HTML;
html {
head {
meta(charset="UTF-8");
link(rel="stylesheet", type="text/css", href="./hayabusa_report.css");
}
body : Raw(input_html.clone().as_str())
}
});
writeln!(html_writer,"{}", html_data).ok();
println!(
"HTML Report was generated. Please check {} for details.",
path_str