2025-06-26 23:21:16 +01:00
2025-06-26 23:21:16 +01:00
2025-06-26 23:20:57 +01:00
2025-06-26 23:20:26 +01:00
2025-06-26 23:20:57 +01:00
2025-06-26 23:20:57 +01:00
2025-06-26 23:20:26 +01:00
2025-06-26 23:19:54 +01:00

nu_plugin_tera

A Nushell plugin to use Tera templates.

Installing

Clone this repository

Build from source

> cargo install --path .

Nushell

In a Nushell

> plugin add ~/.cargo/bin/nu_plugin_tera

Usage

> tera-render <template> (context)

Flags:

  • -h, --help: Display the help message for this command

Parameters:

  • template : Ruta al archivo .tera
  • context : Datos de contexto (record o JSON path) (optional)

Examples

Render template.tera with a record as context from the pipeline.

template.tera:

Hello, {{ name }}!Projects:
{% for project in projects -%}
- {{ project.name }} ({{ project.status }})
{% endfor %}

Other options

> open data.json | wrap value | tera-render template.tera
> open data.json | tera-render template.tera
> { name: 'Akasha', projects: [ {'name': 'TheProject' , 'status': 'active' }]  } | tera-render template.tera

Result:

  Hello, Akasha!
  Projects:
  - TheProject (active)
Description
A Nushell plugin to use Tera templates
Readme MIT 79 KiB
Languages
Nushell 61.6%
Rust 38.4%