hbs-cli

Crates.iohbs-cli
lib.rshbs-cli
version0.2.5
sourcesrc
created_at2020-01-27 11:03:22.826187
updated_at2024-07-17 21:58:51.314279
descriptionSimple CLI for generating text from handlebars templates, by feeding them with data from file YAML/JSON.
homepagehttps://github.com/olorin37/hbs-cli
repositoryhttps://github.com/olorin37/hbs-cli
max_upload_size
id202381
size23,469
Jakub A. G. (olorin37)

documentation

https://docs.rs/crate/hbs-cli

README

Simple Handlebars CLI

Simple, but already useful CLI for generating text from handlebars templates, by feeding them with data from file (YAML parser used is for it, so JSON is also supported), writen in Rust programming language (with usage serde_yaml and handlebars crates).

Goal

The idea is to prepare utility which should be easly used from shell script.

Usage

The simplest call:

hbs-cli <properties file> <template file> > <output file>

or

hbs-cli <properties file> <template file> -o <output file>

Or with template registration for using them as partials:

hbs-cli <properties file> <template file> -r 'partials/**/*.hbs'

Where <properties file> can be ether YAML or JSON (as YAML parser is a JSON parser too) and <template file> is handlebars template. Template is generated on standard output.

To see more options call hbs-cli --help.

Building

# to install rust toolchain, skip if already installed
rustup toolchain install stable 

cargo build --release

License badge

This software is distributed under MIT license. See LICENSE file in the root of the repository.

Commit count: 40

cargo fmt