Skip to content

CLI

JinjaRope contains a simple CLI interface which allows rendering Jinja templates using the JinjaRope Environment.

Very basic usage:

jinjarope -i "input_file.jinja" [-o "output.md"] [-j "additional_jinja_files.toml"] [...]

Since jinjarope is using fsspec in the background, templates can be loaded from all filesystems fsspec understands. This allows to load templates from http:// sources, zip files, specific git revisions and a lot more different sources. The same counts for the output path.

jinjarope -i "github://phil65:mknodes@main/docs/icons.jinja" -o "output.md" -j "path_to_jinja_file.toml"

render

Render a Jinja template.

Args: template_path: Path to a (remote) template file. cfg_files: JinjaFiles to load. output: Output path for resolved template. If not given, print to stdout. undefined: Set undefined behavior. Overrides JinjaFiles settings. trim_blocks: Trim blocks. Overrides JinjaFiles settings.

render [OPTIONS]

--input-file, -i

Path to a (remote) template file.

--jinja-file, -j

Multiple values allowed. JinjaFiles to load.

--output-file, -o

Output path for resolved template. If not given, print to stdout.

--undefined, -u

Default: strict Set undefined behavior. Overrides JinjaFiles settings.

--trim-blocks, -t

Flag Trim blocks. Overrides JinjaFiles settings.

--install-completion

Flag Install completion for the current shell.

--show-completion

Flag Show completion for the current shell, to copy it or customize the installation.

--help

Flag Show this message and exit.