html

Function html 

Source
pub fn html<'a>(
    returns: &ReturnSeries,
    options: HtmlReportOptions<'a>,
) -> Result<String, HtmlReportError>
Examples found in repository?
examples/html_report.rs (line 14)
5fn main() -> Result<(), Box<dyn std::error::Error>> {
6    // Use shared demo data from examples/common.rs (generated from data file)
7    let series = common::demo_strategy();
8
9    let options = HtmlReportOptions::default()
10        .with_title("Quantstats-rs Demo Tearsheet")
11        .with_strategy_title("Demo Strategy")
12        .with_output("tearsheet.html");
13
14    let html = html(&series, options)?;
15
16    println!(
17        "Generated HTML report ({} bytes) at tearsheet.html",
18        html.len()
19    );
20
21    Ok(())
22}
More examples
Hide additional examples
examples/html_with_benchmark.rs (line 17)
5fn main() -> Result<(), Box<dyn std::error::Error>> {
6    // Use shared demo data from examples/common.rs (generated from data file)
7    let strategy = common::demo_strategy();
8    let benchmark = common::demo_benchmark();
9
10    let options = HtmlReportOptions::default()
11        .with_benchmark(&benchmark)
12        .with_title("Quantstats-rs Demo Tearsheet (with Benchmark)")
13        .with_strategy_title("Strategy")
14        .with_benchmark_title("Benchmark Index")
15        .with_output("tearsheet_with_benchmark.html");
16
17    let html = html(&strategy, options)?;
18
19    println!(
20        "Generated HTML report with benchmark ({} bytes) at tearsheet_with_benchmark.html",
21        html.len()
22    );
23
24    Ok(())
25}