Skip to content

kbvernon/extera

Repository files navigation

extera

R-CMD-check CRAN status extendr

The name extera is a portmanteau of extendr and tera, making it suggestive of the package’s intended purpose, which is to provide an extendr-powered R wrapper around the blazing fast tera templating-engine in Rust.

Installation

You can install the development version of extera like so:

# install.packages("pak")
pak::pak("kbvernon/extera")

Usage

To get a feel for what extera can do, let’s start with a simple “hello world” example.

library(extera)

tera <- ExTera$new()

tera$add_string_templates(
  "hello-world" = '<p>Hello {{ x }}. This is {{ y }}.</p>'
)

tera
#> ── ExTera ──
#> Template library:
#> • hello-world

tera$render_to_string(
  "hello-world",
  x = "world",
  y = "ExTera"
)
#> [1] "<p>Hello world. This is ExTera.</p>"

The syntax and API should look pretty familiar to anyone who has used glue to do something like glue::glue("Foo { x }", x = "bar"). The big difference is the object-oriented workflow. To learn more, check out the Getting started article on the package website, or call vignette("extera").

About

Template engine built on tera

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages