Thanks to visit codestin.com
Credit goes to lib.rs

3 releases (breaking)

Uses new Rust 2024

0.3.0 Aug 24, 2025
0.2.0 Aug 18, 2025
0.1.0 Aug 10, 2025

#208 in Template engine

Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

115 downloads per month

MIT/Apache

38KB
920 lines

Gunny

GitHub Actions Workflow Status Crates.io Version Crates.io License

Fast, simple text-based content generation from templates.

Usage

Inline templating and variable substitution

# Inline template variable substitution with output to stdout. Useful when
# subtituting either templates or variable values from environment variables.
gunny -t 'Hello {{name}}!' -v name=Michael
# Hello Michael!

# Inline template with multiple variable substitution.
gunny -t 'Hello {{name}}! Today is {{date}}' -v name=Michael -v date="$(date)"
# Hello Michael! Today is 2025-08-04

Supplying templates from a file

echo 'Hello {{name}}!' > ./template.hbs
gunny --template-file template.hbs -v name=Michael
# Hello Michael!

Piping templates through stdin

echo 'Hello {{name}}!' | gunny -v name=Michael --stdin template
# Hello Michael!

Supplying variables from a file

At present only JSON files are supported.

echo '{"name": "Michael"}' ./vars.json
gunny -t 'Hello {{name}}!' --variable-file vars.json

Supplying variables via stdin

At present only JSON-formatted data is supported.

echo '{"name": "Michael"}' | gunny -t 'Hello {{name}}!'

Templates

At present, only the Handlebars template engine is supported. In future, more template engines will be supported.

License

Licensed under either of

at your option.

Dependencies

~12MB
~221K SLoC