Skip to contents

epoxy 0.1.1

CRAN release: 2023-06-11

  • epoxy_transform_html() now (again) returns a collapsed character string for inline HTML transformations. This makes it easier to wrap a vector in individual HTML tags and then slot it into a parent template. You can still get length-consistent output by setting collapse = FALSE, which is most useful when you want the template around the expression to repeat. (#96)

  • Fixed an issue with epoxy_transform_set() that prevented it from working when knitr::opts_current$get("engine") returned an unexpected value.

epoxy 0.1.0

CRAN release: 2023-05-30

This is epoxy’s first release on CRAN! This NEWS file collects changes from versions that were available on GitHub prior to the CRAN release.

Breaking Changes

  • epoxy’s knitr engine is now epoxy and not glue. This avoids a name clash with the glue package, which provides a glue knitr engine with similar functionality. epoxy also provides epoxy_html and epoxy_latex knitr engines, although they can still be used via their aliases glue_html and glue_latex. (#21)

  • The development version of epoxy included, for some time, two features that have changed significantly in this release:

  • epoxy_transform_html() now returns a character vector rather than a collapsed character string when a template expression is a vector.

New Features

Improvements and Bug Fixes

  • Added a new vignette("inline-reporting") with thanks to @tjmahr for the inspiration (#25).

  • epoxy requires glue >= 1.5.0.

  • ui_epoxy_html() will now render elements with IDs using the # syntax, e.g. {{h3#name.author full_name}} will create an element that is (essentially) <h3 id="name" class="author">{{ full_name }}</h3> (#22).

  • ui_epoxy_html(), instead of updating the entire ui_epoxy_html() region, now only updates the part of the UI that has actually changed. If the template variables are only included in the text portion of the template, you should prefer ui_epoxy_html() over ui_epoxy_mustache() for this reason – ui_epoxy_mustache() re-renders the entire template with every update.

  • The epoxy transformers for bold, italic and code transformations now choose the correct syntax for the epoxy (markdown), epoxy_html and epoxy_latex engines. Alternatively, you can force the desired syntax by setting the syntax option (#28).

  • epoxy’s knitr engines can now be set manually via the newly exported (and renamed) use_epoxy_knitr_engines(). This function is called when epoxy is loaded, so you most likely do not need to call it directly. In general, you can instead simply library(epoxy). epoxy previously provided a glue chunk rather than an epoxy chunk and you can restore this behavior by calling use_epoxy_glue_engine() (#30).

  • A new transformer, epoxy_transform_apply(), can be used to globally apply a function to glue expressions. epoxy_transform_apply() uses the same syntax as purrr::map() for defining the function, i.e. tolower or ~ tolower(.x) (#37).

  • epoxy_transform_collapse() now uses the and package, which provides language-aware conjoining of strings. As a result, the sep_and and sep_or arguments of epoxy_transform_collapse() are deprecated and are silently ignored if provided (#45).

  • Added engine_pick() for providing a set of options where the correct option will be chosen based on the current chunk or epoxy engine.

epoxy 0.0.2

  • Added a whisker engine that uses the whisker package instead of glue.

  • The chunk option glue_data was changed to data.

  • The glue_html engine now uses {{ and }} for open/close delimiters.

  • glue/whisker chunks now accept .envir chunk option for the containing environemnt, otherwise falling back to the knitr::knit_global() env.