pub fn interpolate(source: &str, ctx: &Context) -> String
Expand description

Regex-based var binding replacement inside of a string slice

§Example

use proplate_core::{gen::bootstrap::Context, template::interpolation::interpolate};

let mut ctx = Context::new();
ctx.insert("name".to_string(), "proplate".to_string());
println!("{}", interpolate("Hello $name", &ctx)); // "Hello proplate"