The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

tera

R-CMD-check CRAN status extendr

The tera package uses extendr to provide access to Vincent Prouillet’s Tera templating engine in Rust. Users mainly interact with a Tera R6 object, which serves as a template library with encapsulated methods for rendering templates with a given context. Template syntax supports additional logic, including built-in filters, tests, and functions, as well as loops, conditions, and inheritance. Documentation for Tera’s templating syntax can be found at https://keats.github.io/tera/.

Installation

The published CRAN version:

install.packages("tera")

The development version:

# install.packages("pak")
pak::pak("kbvernon/tera-r")

Usage

Here is a simple hello-world example:

library(tera)

tera <- Tera$new()

tera$render_string(
  '<p>Hello {{ x }}. This is {{ y }}.</p>',
  x = "world",
  y = "tera"
)
#> [1] "<p>Hello world. This is tera.</p>"

To learn more, check out the Getting started article on the package website, or call vignette("tera").

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.