Skip to main content

render

Function render 

Source
pub fn render(template: &str, vars: &BTreeMap<String, String>) -> String
Expand description

Replace {{VAR}} placeholders using the provided map.

ยงExamples

use horto_os_ui_shared::kits::template;
use std::collections::BTreeMap;

let mut vars = BTreeMap::new();
vars.insert("MY_HOSTNAME".into(), "box1".into());
assert_eq!(template::render("host={{MY_HOSTNAME}}", &vars), "host=box1");