mdbook-plotly 0.1.7-alpha

An mdbook preprocessor that renders plot code blocks (e.g., ```plot) into interactive or static charts during book build.
Documentation
use mdbook_plotly::preprocessor::handlers::code_handler;
use plotly::{Configuration, Layout, Plot};

#[test]
fn test_json5() {
    let raw_code = r#"
    {
        layout: {
            title: "Test",
        },
        config: {
            static_plot: true,
        }
    }
    "#;
    let generated_plot = code_handler::handle_json_input(raw_code.to_string()).unwrap();

    let mut reasonable_plot = Plot::new();
    let config = Configuration::new().static_plot(true);
    reasonable_plot.set_configuration(config);
    let layout = Layout::new().title("Test");
    reasonable_plot.set_layout(layout);

    assert!(reasonable_plot == generated_plot);
}