Function proplate_core::template::interpolation::interpolate
source · pub fn interpolate(source: &str, ctx: &Context) -> StringExpand 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"