Only print the contexts.

This allows us to pipe the output to jq to see the context easier. We can see the rendered output in the files written to disk.
This commit is contained in:
Tom Alexander
2023-10-24 00:51:28 -04:00
parent 2b7a19a1d4
commit 31a3efe417
6 changed files with 10 additions and 7 deletions

View File

@@ -34,7 +34,7 @@ impl<'a> RendererIntegration<'a> for DusterRenderer<'a> {
}
// TODO: This is horribly inefficient. I am converting from a serialize type to json and back again so I can use the existing implementation of IntoContextElement. Honestly, I probably need to rework a lot of duster now that I've improved in rust over the years.
let json_context = serde_json::to_string(&context)?;
println!("Context: {}", json_context);
println!("{}", json_context);
let parsed_context: serde_json::Value = serde_json::from_str(json_context.as_str())?;
let rendered_output = dust_renderer.render("main", Some(&parsed_context))?;
Ok(rendered_output)