# `ElementorexCms`
[🔗](https://github.com/rocket4ce/elementorex_cms/blob/v0.1.0/lib/elementorex_cms.ex#L1)

A visual, drag & drop content builder for Phoenix LiveView.

The pieces:

  * `ElementorexCms.Document` - the content: a JSON tree of nodes you store in
    a `jsonb` column (`ElementorexCms.Ecto.Document`)
  * `ElementorexCms.Block` - the components a document is made of. The
    library ships 34 blocks built with daisyUI 5 and Heroicons; write your own
    with `mix elementorex.gen.block`
  * `ElementorexCms.Components.document/1` - renders a document on your site,
    with its CSS, safely (everything is sanitized again on render)
  * `ElementorexCms.Editor` - the editor, a LiveComponent: palette, DOM tree,
    canvas with your site's CSS in an iframe, inspector (*Content*, *Style*,
    *Advanced*), HTML/CSS/JSON view, undo and redo

See the README for the installation steps and `mix elementorex.install` to
check them.

# `to_html`

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

Renders a document to an HTML string (with its `<style>`). Shortcut for
`ElementorexCms.Renderer.to_html/2`.

# `to_text`

```elixir
@spec to_text(map()) :: String.t()
```

Plain text of a document (for excerpts and search). Text of headings,
paragraphs, buttons and list items, in order.

# `version`

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

Version of the library.

---

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