# `DialectoInContext`
[🔗](https://github.com/dialecto-eu/dialecto-phoenix/blob/v0.1.0/lib/dialecto_in_context.ex#L1)

Dialecto's in-context editor for Phoenix apps translated with gettext
(spec-0017). Dev-only: add it as a `only: :dev` dependency and opt in with
two guarded lines that compile to nothing where the dependency is absent,
so production carries no trace of it:

    # mix.exs
    {:dialecto_in_context, "~> 0.1", only: :dev}

    # lib/my_app_web/gettext.ex, after `use Gettext.Backend, …`
    if Code.ensure_loaded?(DialectoInContext.Gettext), do: @before_compile(DialectoInContext.Gettext)

    # lib/my_app_web/endpoint.ex, before the router
    if Code.ensure_loaded?(DialectoInContext.Plug), do: plug(DialectoInContext.Plug)

`DialectoInContext.Gettext` marks every translation while the editor is
open; `DialectoInContext.Plug` loads the editor's overlay into the app's
pages and answers it on `/__dialecto/*`. Settings: `DialectoInContext.Config`.

# `unmarked`

```elixir
@spec unmarked((-&gt; result)) :: result when result: term()
```

Runs `fun` with live-site markers off (spec-0025 §4 step 3). A mail rendered
inline while an editor's page is rendering must go through this, or the
editor's markers would reach the recipient:

    DialectoInContext.unmarked(fn -> MyApp.Mailer.deliver(welcome_email(user)) end)

# `version`

```elixir
@spec version() :: String.t()
```

The add-on's version, reported to the sidebar.

---

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