Skip to main content

render

Function render 

Source
pub fn render(
    template_dir: &Path,
    output_dir: &Path,
    config: &Config,
    overwrite: bool,
) -> Result<Vec<PathBuf>, GeneratorError>
Expand description

Render templates from a template directory to an output directory

§Arguments

  • template_dir - Directory containing .liquid template files
  • output_dir - Directory where rendered files will be written
  • config - Configuration containing template variables (rust_bucket_version, test_timeout)
  • overwrite - If false, fail if any target file exists. If true, replace existing files.

§Returns

A list of all generated file paths on success

§Errors

Returns GeneratorError if:

  • Template directory doesn’t exist or isn’t readable
  • Template parsing or rendering fails
  • IO errors occur during file operations
  • File conflicts are detected when overwrite=false