Ltix.DeepLinking.ContentItem.HtmlFragment (Ltix v0.1.0)

Copy Markdown View Source

An HTML fragment content item for Deep Linking responses.

Represents a chunk of HTML that the platform embeds directly.

Options

  • :title (String.t/0) - Title for the content item.

  • :text (String.t/0) - Plain-text description.

  • :extensions (map/0) - Required. Vendor-specific extension properties. The default value is %{}.

  • :html (String.t/0) - Required. HTML markup to embed.

Summary

Functions

Create a new HTML fragment content item.

Types

t()

@type t() :: %Ltix.DeepLinking.ContentItem.HtmlFragment{
  extensions: %{optional(binary()) => any()},
  html: binary(),
  text: binary(),
  title: binary()
}

Functions

new(opts)

@spec new(keyword()) :: {:ok, t()} | {:error, Exception.t()}

Create a new HTML fragment content item.

Examples

iex> {:ok, fragment} = Ltix.DeepLinking.ContentItem.HtmlFragment.new(html: "<p>Hello</p>")
iex> fragment.html
"<p>Hello</p>"

iex> {:error, %Ltix.Errors.Invalid{}} =
...>   Ltix.DeepLinking.ContentItem.HtmlFragment.new([])