Renders documents and nodes with the blocks of a registry.
ElementorexCms.Components.document/1 is the usual entry point in templates;
this module is the engine underneath, plus to_html/2 to get a string (emails,
caches, the editor canvas).
Every value reaches the blocks cast and sanitized again (see
ElementorexCms.Block.assigns/2), and documents are normalized before being
rendered, so a stored document cannot inject markup, script or CSS even if it
was edited by hand.
Summary
Functions
A render context. Options: :mode, :registry (default
ElementorexCms.Registry.default/0) and :data.
Renders one node (and its children) with its block.
HTML of a whole document (its <style> included) or of a single node, as a
string.
Functions
@spec context(keyword()) :: ElementorexCms.Renderer.Context.t()
A render context. Options: :mode, :registry (default
ElementorexCms.Registry.default/0) and :data.
@spec render_node(map(), ElementorexCms.Renderer.Context.t()) :: Phoenix.LiveView.Rendered.t() | String.t()
Renders one node (and its children) with its block.
@spec to_html(ElementorexCms.Document.t() | map(), keyword()) :: String.t()
HTML of a whole document (its <style> included) or of a single node, as a
string.
Options: :mode, :registry, :data (like context/1) and, for documents,
:class.