# `CommBus.Template`
[🔗](https://github.com/fosferon/comm_bus/blob/v0.1.0/{path}#L{line})

Template rendering facade.

# `render`
[🔗](https://github.com/fosferon/comm_bus/blob/v0.1.0/{path}#L{line})

```elixir
@spec render(String.t(), map(), keyword()) ::
  {:ok, CommBus.Template.RenderResult.t()}
  | {:error, CommBus.Template.RenderError.t()}
```

Renders a Mustache template string with the given variable bindings using the
configured template engine.

## Parameters

  - `template` — A Mustache template string.
  - `values` — A map of variable names to values.
  - `opts` — Keyword options:
    - `:engine` — Template engine module (default from app config).
    - `:strict_mode` — Whether to raise on missing variables (default: engine-specific).
    - `:types` — Variable type declarations for coercion.
    - `:partials` — Map of partial name to template body.
    - `:partials_func` — Function that resolves partial names to bodies.

## Returns

`{:ok, %RenderResult{}}` on success or `{:error, %RenderError{}}` on failure.

# `render_content`
[🔗](https://github.com/fosferon/comm_bus/blob/v0.1.0/{path}#L{line})

```elixir
@spec render_content(String.t(), map(), keyword()) ::
  {:ok, String.t()} | {:error, CommBus.Template.RenderError.t()}
```

Renders a Mustache template and returns only the content string, discarding
render metadata. A convenience wrapper around `render/3`.

## Parameters

  - `template` — A Mustache template string.
  - `values` — A map of variable bindings.
  - `opts` — Keyword options forwarded to `render/3`.

## Returns

`{:ok, content_string}` on success or `{:error, %RenderError{}}` on failure.

# `render_prompt`
[🔗](https://github.com/fosferon/comm_bus/blob/v0.1.0/{path}#L{line})

```elixir
@spec render_prompt(CommBus.Template.Prompt.t(), map(), keyword()) ::
  {:ok, CommBus.Template.RenderResult.t()}
  | {:error, CommBus.Template.RenderError.t()}
```

Renders a prompt struct's body template with the given variables, automatically
incorporating the prompt's declared variable types and name.

## Parameters

  - `prompt` — A `%CommBus.Template.Prompt{}` struct with a `:body` template.
  - `variables` — A map of variable bindings.
  - `opts` — Keyword options forwarded to `render/3`.

## Returns

`{:ok, %RenderResult{}}` on success or `{:error, %RenderError{}}` on failure.

---

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