# Braces v0.1.0 - API Reference

## Modules

- [Braces.HubL.Phoenix.Engine](Braces.HubL.Phoenix.Engine.md): A `Phoenix.Template` engine for HubL files. Only defined when `phoenix_template` is
installed.
- [Braces.Mailchimp.Phoenix.Engine](Braces.Mailchimp.Phoenix.Engine.md): A `Phoenix.Template` engine for Mailchimp files. Only defined when `phoenix_template` is
installed.
- [Braces.Mustachio.Phoenix.Engine](Braces.Mustachio.Phoenix.Engine.md): A `Phoenix.Template` engine for Mustachio files. Only defined when `phoenix_template` is
installed.
- [Braces.Template](Braces.Template.md): A compiled template in Liquid, Jinja, Django, Nunjucks, Twig, Tera, HubL, Mailchimp
or Mustachio: from the language module's `compile/2`, or its sigil, such as `~JINJA`, which
compiles the template with your code.

- Braces
  - [Braces](Braces.md): Templates written in braces, `{{ }}`, in Elixir: rendered, compiled into your app, and
converted from one language to another.
  - [Braces.IR](Braces.IR.md): The template that every language converts to and from: each language's parser reads its
source into a `Braces.IR`, and each language's printer writes one out, so
`Braces.convert/2` converts from any language to any other.

- Handlebars
  - [Braces.Handlebars](Braces.Handlebars.md): Handlebars templates in Elixir, rendered as Handlebars.js 4.7.10 renders them.
  - [Braces.Handlebars.SafeString](Braces.Handlebars.SafeString.md): Text that `Braces.Handlebars.render/3` writes without HTML escaping, even in `{{value}}`, like
Handlebars.js's `SafeString`. Make one with `Braces.Handlebars.safe/1`. A `{:safe, iodata}` tuple,
as `Phoenix.HTML` makes, is written without escaping too.

  - [Braces.Handlebars.Sigil](Braces.Handlebars.Sigil.md): The `~HBS` sigil: a Handlebars template compiled with your code, as HEEx compiles
`~H`. It gives a `Braces.Handlebars.Template` whose `render` function was generated from the
template, so `Braces.Handlebars.render/3` runs that code instead of reading the AST, and a path such
as `{{user.name}}` looks up `:user` and `:name` in atom-keyed data without converting strings
to atoms. It renders exactly as a template from `Braces.Handlebars.compile/2` does.
  - [Braces.Handlebars.Template](Braces.Handlebars.Template.md): A Handlebars template for `Braces.Handlebars.render/3`: its `source`, its parsed `ast` and, for a
`~HBS` template, `render`, the function compiled from it that renders it.
`Braces.Handlebars.compile/2` leaves `render` as `nil`, and `render/3` reads the AST instead.
`to_string/1` gives the source.

- Helpers
  - [Braces.Handlebars.Helpers](Braces.Handlebars.Helpers.md): Custom helpers for `Braces.Handlebars.render/3`, written as Elixir functions.
  - [Braces.Handlebars.Helpers.Options](Braces.Handlebars.Helpers.Options.md): The last argument of a custom helper (see `Braces.Handlebars.Helpers`), as Handlebars.js's
`options`

- Phoenix
  - [Braces.HTML](Braces.HTML.md): Templates in any language rendered as safe HTML for Phoenix, such as a stored email
template previewed in a LiveView. Only defined when `phoenix_live_view` is installed.
  - [Braces.Handlebars.HTML](Braces.Handlebars.HTML.md): Handlebars rendered as safe HTML for Phoenix: `Braces.HTML` for Handlebars, which also
takes an AST from `Braces.Handlebars.parse/2`. Only defined when `phoenix_live_view` is
installed.
  - [Braces.Handlebars.Phoenix.Engine](Braces.Handlebars.Phoenix.Engine.md): A `Phoenix.Template` engine for `.hbs` files. Only defined when `phoenix_template` is
installed.

- Mustache
  - [Braces.Mustache](Braces.Mustache.md): Mustache templates, rendered as the [Mustache spec](https://github.com/mustache/spec) (1.4)
says.
  - [Braces.Mustache.Phoenix.Engine](Braces.Mustache.Phoenix.Engine.md): A `Phoenix.Template` engine for `.mustache` files. Only defined when `phoenix_template` is
installed.
  - [Braces.Mustache.Template](Braces.Mustache.Template.md): A parsed Mustache template, from `Braces.Mustache.compile/1`: its `source`, and the parsed
`tree` that `Braces.Mustache.render/3` renders.

- Jinja family
  - [Braces.Django](Braces.Django.md): Django templates, rendered as Django renders them.
  - [Braces.Django.Phoenix.Engine](Braces.Django.Phoenix.Engine.md): A `Phoenix.Template` engine for Django files. Only defined when `phoenix_template` is
installed.
  - [Braces.Jinja](Braces.Jinja.md): Jinja templates, rendered as Jinja renders them.
  - [Braces.Jinja.Phoenix.Engine](Braces.Jinja.Phoenix.Engine.md): A `Phoenix.Template` engine for `.jinja` files. Only defined when `phoenix_template` is
installed.
  - [Braces.Nunjucks](Braces.Nunjucks.md): Nunjucks templates, Mozilla's Jinja for JavaScript, rendered as Nunjucks renders them.
  - [Braces.Nunjucks.Phoenix.Engine](Braces.Nunjucks.Phoenix.Engine.md): A `Phoenix.Template` engine for Nunjucks files. Only defined when `phoenix_template` is
installed.
  - [Braces.Tera](Braces.Tera.md): Tera templates, the Jinja of Rust, rendered as Tera renders them.
  - [Braces.Tera.Phoenix.Engine](Braces.Tera.Phoenix.Engine.md): A `Phoenix.Template` engine for Tera files. Only defined when `phoenix_template` is
installed.
  - [Braces.Twig](Braces.Twig.md): Twig templates, the Jinja of PHP's Symfony, Drupal and Craft, rendered as Twig renders them.
  - [Braces.Twig.Phoenix.Engine](Braces.Twig.Phoenix.Engine.md): A `Phoenix.Template` engine for Twig files. Only defined when `phoenix_template` is
installed.

- Liquid
  - [Braces.Liquid](Braces.Liquid.md): Liquid templates, rendered as Liquid renders them.
  - [Braces.Liquid.Phoenix.Engine](Braces.Liquid.Phoenix.Engine.md): A `Phoenix.Template` engine for `.liquid` files. Only defined when `phoenix_template` is
installed.

- Errors
  - [Braces.ConversionError](Braces.ConversionError.md): A template that can't be converted or rendered: `description` says what, and `line` (from
1) and `column` (from 0) say where, when they're known.

  - [Braces.Mustache.ParseError](Braces.Mustache.ParseError.md): A Mustache template that doesn't parse. `description` says what's wrong, `line` counts from
1 and `column` from 0, and `message` adds the template's line with a caret under the error.

  - [Braces.Handlebars.ParseError](Braces.Handlebars.ParseError.md): A Handlebars template that doesn't parse. `line` counts from 1 and `column` from 0, in UTF-16
code units, as Handlebars.js reports them. `description` is Handlebars.js's message, and
`message` adds the template's line with a caret under the error.

  - [Braces.Handlebars.RenderError](Braces.Handlebars.RenderError.md): A template that can't be rendered with the data it was given, such as a missing value with
`strict: true` or a helper that isn't defined. `description` is the message Handlebars.js
gives for the same template and data where it gives one, except that a strict lookup names
the object it missed `data` where Handlebars.js writes `[object Object]`. `line` counts from 1 and `column`
from 0, in UTF-16 code units, at the tag or path that failed, in the partial named by
`partial` when it failed in one. `message` adds the position and, when the template's source
is known, its line with a caret under the error.

- Email providers
  - [Braces.Filters](Braces.Filters.md): The filters, tests and operators of Jinja, Django, Nunjucks, Twig, Tera, Mailchimp, HubL and
Klaviyo, which those languages' modules render with. They're Handlebars helpers, so a
template converted to Handlebars renders with them too
  - [Braces.HubL](Braces.HubL.md): HubSpot's HubL templates, its Jinja for emails and pages.
  - [Braces.Mailchimp](Braces.Mailchimp.md): Mailchimp's merge tags, `*|FNAME|*`, rendered as Mailchimp fills them in, with the merge
fields as the data, by their tags' names.
  - [Braces.Mustachio](Braces.Mustachio.md): Mustachio templates, the language of Postmark's templates, rendered as Mustachio renders
them.
  - [Braces.SendGrid](Braces.SendGrid.md): The helpers of SendGrid's dynamic templates, which are Handlebars: render a SendGrid
template as SendGrid sends it.

- Tooling
  - [Braces.Handlebars.Formatter](Braces.Handlebars.Formatter.md): A `mix format` plugin for Handlebars: `.hbs` and `.handlebars` files, and `~HBS`
sigils.

- AST
  - [Braces.Handlebars.Printer](Braces.Handlebars.Printer.md): Prints a Handlebars AST in the debugging format of handlebars-parser's `print`, so an AST can
be compared against Handlebars.js.
  - [Braces.Handlebars.AST.BlockStatement](Braces.Handlebars.AST.BlockStatement.md): `{{#path params hash}}program{{else}}inverse{{/path}}`, an inverted `{{^path}}` block, or a `{{{{raw}}}}` block.

  - [Braces.Handlebars.AST.BooleanLiteral](Braces.Handlebars.AST.BooleanLiteral.md): `true` or `false`.

  - [Braces.Handlebars.AST.CommentStatement](Braces.Handlebars.AST.CommentStatement.md): `{{! … }}` or `{{!-- … --}}`; `value` is the text inside.

  - [Braces.Handlebars.AST.ContentStatement](Braces.Handlebars.AST.ContentStatement.md): Text between mustaches. `original` is the text as written and `value` the text after whitespace control.

  - [Braces.Handlebars.AST.Decorator](Braces.Handlebars.AST.Decorator.md): `{{* path params hash}}`.

  - [Braces.Handlebars.AST.DecoratorBlock](Braces.Handlebars.AST.DecoratorBlock.md): `{{#* path params hash}}program{{/path}}`.

  - [Braces.Handlebars.AST.Hash](Braces.Handlebars.AST.Hash.md): The `key=value` pairs after a helper's params.

  - [Braces.Handlebars.AST.HashLiteral](Braces.Handlebars.AST.HashLiteral.md): A mustache or sub-expression that is only `key=value` pairs, such as `{{(a=b)}}`.

  - [Braces.Handlebars.AST.HashPair](Braces.Handlebars.AST.HashPair.md): One `key=value` pair.

  - [Braces.Handlebars.AST.MustacheStatement](Braces.Handlebars.AST.MustacheStatement.md): `{{path params hash}}`; `escaped` is false for `{{{…}}}` and `{{&…}}`.

  - [Braces.Handlebars.AST.NullLiteral](Braces.Handlebars.AST.NullLiteral.md): `null`.

  - [Braces.Handlebars.AST.NumberLiteral](Braces.Handlebars.AST.NumberLiteral.md): A number.

  - [Braces.Handlebars.AST.PartialBlockStatement](Braces.Handlebars.AST.PartialBlockStatement.md): `{{#> name params hash}}program{{/name}}`.

  - [Braces.Handlebars.AST.PartialStatement](Braces.Handlebars.AST.PartialStatement.md): `{{> name params hash}}`; `indent` is the whitespace before a standalone partial.

  - [Braces.Handlebars.AST.PathExpression](Braces.Handlebars.AST.PathExpression.md): A path such as `foo.bar`, `../foo`, `this.foo` or `@index`. `head` is the first part, or a sub-expression for `(helper).foo`; `depth` counts `../`.

  - [Braces.Handlebars.AST.Program](Braces.Handlebars.AST.Program.md): A list of statements: the template, or a block's body or `{{else}}` body. `chained` marks an `{{else if …}}` body.

  - [Braces.Handlebars.AST.StringLiteral](Braces.Handlebars.AST.StringLiteral.md): A quoted string.

  - [Braces.Handlebars.AST.SubExpression](Braces.Handlebars.AST.SubExpression.md): `(path params hash)`.

  - [Braces.Handlebars.AST.UndefinedLiteral](Braces.Handlebars.AST.UndefinedLiteral.md): `undefined`.

