Rivet.Template (rivet v2.5.2)

View Source

Rivet Templates. Structure:

  • ^=== (.*)$ is the delimiter, where the captured part is the section label
  • First line of file MUST be === rivet-template-v1
  • Delimiter of equals vs dashes so that individual sections may include yaml which has multiple yaml docs within.
  • First section is a "meta" section defining the other sections in any order, matching off the key:value pair where the key is the section label, and the value of the key:value pair represents the type of data within that section.
sections:
  - constants: yml
  - inputs: eex-yml
  - rack: eex-yml

With this example there would be a total of four sections in the template (the first being this spec), and the next three are labelled as shown.

Summary

Functions

load_file(path, opts \\ [])

load_string(string, opts \\ [])