Jango
A CLI application to populate your templates.
Features
- Create templates with Jinja-inspired Tera syntax.
- Custom
content
field that can be populated with the command line. - Arbitrary template fields with Markdown TOML frontmatters.
- Written in Rust, btw.
Installation
Prebuilt Binaries
Install prebuilt binaries via shell script
|
This works for both Linux & MacOS.
Install prebuilt binaries via powershell script
You can also download the prebuild binaries manually from the releases page.
Crates.io
If you have Rust installed, you can build Jango from source using the crates.io registry.
Or download a prebuilt binary with cargo-binstall.
Usage
With CLI arguments
This mode allows for a template containing any of Tera's builtins and a variable called content
that corresponds to the command line argument of the same name.
The template could look something like this:
{{ content }}
And you would populate it with this command:
Which would result in this file:
date: 2024-04-05
Hello, **world!**
If you are manipulating HTML, you can use the --escape
flag if you wish to escape the input given to the command.
With a Markdown file
When dealing with more complex templates, you can use a Markdown file with a TOML frontmatter to pass any arbitrary variables beyond the file's content
.
The template can look something like this:
<!doctype html>
{{ title }}
{{ content | indent }}
You can write a Markdown file like this:
+++
title = "This is a title"
+++
This is a paragraph.
Then execute a command like this:
Which would result in this file:
<!doctype html>
This is a title
This is a heading
This is a paragraph.
Contributing
Contributions are always welcome!
You're going to need to have Rust installed. I also recommend having Bacon (to handle recompilation) and cargo-nextest (for a nicer interface when running tests) installed.
We also try to conventional commit conventions when contributing to the repo.