Blek le Rat is a fast, simple template tool for the commandline
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Bèr Kessels 6962ba8d25 Merge tag '0.1.1' into develop il y a 3 semaines
src Ensure custom variables override any basic variables il y a 2 mois
templates Implements most basic template. With just a date. il y a 2 mois
tests Ensure custom variables override any basic variables il y a 2 mois
.build.yml Add sourcehut build file. il y a 2 mois
.gitignore Bootstrap cargo with testing tools il y a 4 mois
Cargo.lock Add option to pass in name=value pairs that will be moved into template il y a 2 mois
Cargo.toml Add shields and info for crates il y a 2 mois
LICENCE.txt Add MIT as licence il y a 2 mois
README.md Attempt to fix shields for gitea rendering il y a 2 mois

README.md

Blek

Blek le Rat is a fast, simple template tool for the commandline.

It accepts Jinja2 templates and replaces variables with those you pass along.

invoice.j2:

Date: {{ date }}
Number: {{ number }}
Dear {{ name | default(value="valued customer") }}, this the invoice for 1 pizza. Please pay ฿{{ amount }}.
$ blek invoice.j2 --var amount=10,000 --var "name=John Doe" --var number=$(openssl rand -base64 6)
Date: 2021-01-29
Number: KqSYp872
Dear John Doe, this the invoice for 1 pizza. Please pay ฿10,000.

Crates.io Crates.io

Features

  • Simple, fast, small.
  • Binary. Just download and run (or compile and distribute)
  • Jinja2: A familiar (Liquid, Django, Twig), well documented templating language. We use Tera.
  • Any file can be a template.
  • Comes with ever growing set of basic variables (currently 2… 😋)
  • Unix philosophy; very easy to automate or use in automation.

Quickstart

Cargo: (TODO how to set up Rust and cargo)

cargo install

TODO: release binaries.

Build from source

git checkout https://git.webschuur.com/berkes/blek
cd blek
cargo build

Run

After installing, from the place where it is installed:

blek --help

This builds and runs the platform locally.

Test

After downloading the source:

cargo test

This builds and runs the tests locally. There are very few tests, since there are very few features.