# `Ascii.Render.HTML`
[🔗](https://github.com/houllette/ascii_art/blob/main/lib/ascii/render/html.ex#L1)

A frame as the inside of a `<pre>`: escaped text, and for a coloured frame
a `<span style="color:...">` a run of one colour. A run whose colour is
`nil` (in no coloured part, see `Ascii.Parts`) is plain text, in the
page's own; one in a CSS variable (see `Ascii.Ink`) takes the page's
value for it.

Spaces join whatever run they fall in, so a logo is a few dozen spans and
a full scene a few thousand. That is fine for a still or a logo; to play a
piece live, `Ascii.Phoenix.PlayerLive` sends only what changes.

Phoenix is not needed: the result is plain iodata, already escaped. Put it
in a `<pre>` whose style is `style/1`.

# `escape`

```elixir
@spec escape(text :: iodata()) :: iodata()
```

HTML-escapes text (as iodata).

# `render`

```elixir
@spec render(frame :: Ascii.Frame.t()) :: iodata()
```

The `<pre>`'s contents, escaped: `rows/1` joined by newlines.

# `row`

```elixir
@spec row(frame :: Ascii.Frame.t(), y :: non_neg_integer()) :: iodata()
```

Row `y`'s HTML, as in `rows/1`.

# `rows`

```elixir
@spec rows(frame :: Ascii.Frame.t()) :: [iodata()]
```

Each row's HTML, escaped, without newlines.

# `style`

```elixir
@spec style(frame :: Ascii.Frame.t()) :: String.t() | nil
```

The `<pre>`'s style: the piece's ground behind a coloured frame, else `nil`.

---

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