rustpl

Crates.iorustpl
lib.rsrustpl
version0.1.1
created_at2026-01-14 08:45:39.116621+00
updated_at2026-01-14 08:45:39.116621+00
descriptionTemplate rendering cli tool
homepage
repositoryhttps://github.com/klebed/rustpl
max_upload_size
id2042438
size40,037
(klebed)

documentation

README

rustpl

Template compiler written in πŸ¦€πŸ¦€πŸ¦€ Rust, so it's blazinglyπŸ”₯πŸ”₯πŸ”₯ fast πŸš€πŸš€πŸš€ and memory safe! It may use args, env and json files as input sets of keys/values.

It may be used as generator for:

  1. Declarative/conditional config files
  2. Static pages
  3. Data reports MD/TXT/etc.

It uses Tera template engine, which allows to use nesting/inheritance of templates for better complex workloads.

Example usage:

  rustpl --template samples/main.tpl --template samples/header.tpl\
   --set key=value --render main=/path/filename.txt
{# main.tpl #}
{% include "header" %}
You should see value of **key** here: {{ key }}
{# header.tpl #}
Hello, rustacean!
This is rustpl output!

This would produce following output in /path/filename.txt :

Hello, rustacean!
This is rustpl output!

You should see value of **key** here: value    

For more advanced guidance on template format, read Tera documentation here: https://keats.github.io/tera/docs/

Full CLI arguments description:

#rustpl --help
Usage: rustpl [OPTIONS] --render <TEMPLATE=OUTPUT> --template <TEMPLATE_FILE>

Options:
  -r, --render <TEMPLATE=OUTPUT>  Sets the name of the template to render
  -t, --template <TEMPLATE_FILE>  Specifies the template file to use
  -d, --template-dir <DIR>        Specifies the directory containing templates
  -s, --set <KEY=VALUE>           Sets a variable for the document. You should escape quotes and doublequotes unless you're passing just a string
  -j, --values <FILE>             Path to a JSON file containing values
  -E, --import-env [<PREFIX>]     Import environment variables (optionally filtered by PREFIX, e.g., 'APP_'). WARNING: May expose secrets!
  -v, --verbose                   Enable verbose logging (debug level)
  -h, --help                      Print help
  -V, --version                   Print version
Commit count: 5

cargo fmt