https://github.com/dk26/rendit
CLI tool for rendering `Tera`, `Liquid` or `Handlebars` templates by using JSON files as context.
https://github.com/dk26/rendit
cli command-line command-line-tool commandline handlebars html liquid pipeline rendering rendering-pipeline rust shell template tera
Last synced: 3 months ago
JSON representation
CLI tool for rendering `Tera`, `Liquid` or `Handlebars` templates by using JSON files as context.
- Host: GitHub
- URL: https://github.com/dk26/rendit
- Owner: DK26
- License: mit
- Created: 2022-06-26T22:21:27.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-14T18:26:00.000Z (over 3 years ago)
- Last Synced: 2025-07-09T06:09:14.644Z (12 months ago)
- Topics: cli, command-line, command-line-tool, commandline, handlebars, html, liquid, pipeline, rendering, rendering-pipeline, rust, shell, template, tera
- Language: Rust
- Homepage:
- Size: 262 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rendit (π§WIPπ§)

CLI tool for rendering templates using local JSON files for context. Supports multiple template engines.
## π§WIP Statusπ§
For now, you can download an [alpha release](https://github.com/DK26/rendit/releases) version and play around with it:
[Download Alpha v0.1.5 (i686-pc-windows)](https://github.com/DK26/rendit/releases/download/v0.1.5-alpha/rendit-alpha-v.0.1.5-windows-i686.7z)
### All Releases
## Features
* Renders template input either from file or standard input π§
* Uses either the default or the specified context JSON file for rendering β
* Automatically detects the right rendering engine with either a special starting comment (magic comment) `
Usage Help (click to expand)
```text
USAGE:
rendit [OPTIONS] [TEMPLATE FILE]
ARGS:
The template file to render.
Unless using the `--context `option, this requires either the
`.ctx.json` or the `default.ctx.json` context files to be present in the
template's directory.
[Example]
.
βββ my_template.ctx.json
βββ my_template.html
If `my_template.ctx.json` is missing, `default.ctx.json` will be loaded automatically
from the template's directory.
.
βββ default.ctx.json
βββ my_template.html
If `default.ctx.json` is missing from the template directory, it will be loaded
automatically from the current working directory, instead.
[Output]
Unless using the `--output ` option, providing ``, produces
a `.rendered.` file by default.
.
βββ my_template.html
βββ my_template.rendered.html
By NOT providing ``, STDIN mode is activated. Template data stream will
be expected to come from STDIN, printing the results to STDOUT instead of writing to
file.
OPTIONS:
-c, --context
Override default loading of the context file with the specified context file.
-o, --output
Override default output file path with the specified file path.
--stdout
Print rendered result to STDOUT.
--stderr
Print rendered result to STDERR.
-O, --open
Open the rendered output file with a default software.
-w, --watch
Constantly render changes in the template with the context file every 2 seconds by
default.
-e, --engine
Force rendering with the specified render engine.
Use only when there is no magic comment or a template file extension available.
--engine-list
Print supported engine list for the `--engine ` option.
-x, --extension
Force the underlying template engine to treat the template data as if it is a file of
the given extension. This may affect escaping of special characters.
-v, --verbose
Set the level of verbosity.
`-v` sets logging level to INFO
`-vv` sets logging level to DEBUG
`-vvv` sets logging level to TRACE
WARNING: Effects CLI / STDOUT output.
Use the `--output` switch if you wish to commit the rendered output to file.
Use the `--stderr` switch to avoid including the logger messages in the final output.
-h, --help
Print help information
-V, --version
Print version information
```
## Supported Template Engines
| Name | Short / File Extension | Version | Guide / Manual / Tutorial |
| ---------- | ---------------------- | ------- | ------------------------------------------------------------- |
| Tera | `tera` | v1.17.1 | |
| Handlebars | `hbs` | v4.3.5 | |
| Liquid | `liq` | v0.26.0 | |
## Template Examples
Tera (click to expand)
* Guide:
* Version: **v1.17.1**
* Repository:
* Alternatives: `Jinja2`, `Django`, `Liquid`, `Twig`
A highly advanced, capable and secure by default; rendering engine that follows the OWASP Top 10 guidelines.
A good alternative choice if you are used to template engines such as `Jinja2`, `Django`, `Liquid` or `Twig`. Originated in the Rust programming language.
```html
π§WIPπ§
```
Handlebars (click to expand)
* Guide:
* Version: **v4.3.5**
* Repository:
* Alternatives: `Mustache`
A highly popular rendering engine that has been implemented across many programming languages. Considered to be somewhat more limited in features compared to the other engines. Originated in the Javascript programming language.
```html
π§WIPπ§
```
Liquid (click to expand)
* Guide:
* Version: **v0.26.0**
* Repository:
* Alternatives: `smarty`
A highly advanced, capable and senior rendering engine, offering some optional security capabilities. A good alternative choice if you are used to the `smarty` template engine. Originated in the Ruby programming language.
```html
π§WIPπ§
```