Skip to main content

load_template_with_context

Function load_template_with_context 

Source
pub fn load_template_with_context(
    name: &str,
    project_root: &Path,
    target: Option<&str>,
    strict: bool,
) -> Result<LoadedTemplate>
Expand description

Load a template by name with variable substitution

Checks .ralph/templates/{name}.json first, then falls back to built-in templates. Substitutes template variables ({{target}}, {{module}}, {{file}}, {{branch}}) with context-aware values.

If strict is true and unknown variables are present, returns an error.