# `Otera.Template`
[🔗](https://github.com/georgeguimaraes/otera/blob/v0.2.0/lib/otera/template.ex#L1)

A parsed template. `Otera.parse/2` makes it, and `Otera.render/3` renders it many times without parsing it again.

`name` is the name of the template, `nil` for a template from a string without the `:name` option. `options` holds the options of `Otera.parse/2`, which also apply to each render. `scope` is the root scope from `Otera.Scope`, `blocks` holds the blocks of the template by name, and `extends?` is true when the template has an extends tag.

# `t`

```elixir
@type t() :: %Otera.Template{
  ast: list(),
  blocks: %{required(String.t()) =&gt; tuple()},
  extends?: boolean(),
  name: String.t() | nil,
  options: keyword(),
  scope: Otera.Scope.t(),
  source: String.t()
}
```

# `load`

```elixir
@spec load(String.t(), keyword()) :: t()
```

Loads the template `name` with the `:loader` of `opts` and parses it with `opts`. Raises `Otera.Error` with the kind `:template_not_found`, or `Otera.SyntaxError`.

A template that the loader gives as an `Otera.Template` without a name gets the name `name`. With the `:cache` option, the template comes from that `Otera.Cache` while it is fresh.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
