renderTemplate method

void renderTemplate(
  1. String templatePath,
  2. String outPath,
  3. Map<String, dynamic> context
)

Reads a .mustache template, injects context values, and writes to outPath.

This is intentionally synchronous to keep file creation predictable.

Implementation

void renderTemplate(String templatePath, String outPath, Map<String, dynamic> context) {
  final templateString = File(templatePath).readAsStringSync();
  final template = Template(templateString);
  final result = template.renderString(context);
  File(outPath).writeAsStringSync(result);
}