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

Copy Markdown View Source

A URL link content item for Deep Linking responses.

Use this for external URLs hosted outside your tool, such as articles, documentation, or third-party resources. For links that launch back into your tool via LTI, use Ltix.DeepLinking.ContentItem.LtiResourceLink instead.

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 %{}.

  • :embed (map/0)

  • :url (String.t/0) - Required. URL of the link.

  • :icon (map/0) - Icon or thumbnail for the link.

  • :thumbnail (map/0) - Icon or thumbnail for the link.

  • :window (map/0) - Window presentation for the link.

  • :iframe (map/0) - Iframe presentation for the link.

Summary

Functions

Create a new link content item.

Types

t()

@type t() :: %Ltix.DeepLinking.ContentItem.Link{
  embed: %{html: binary()},
  extensions: %{optional(binary()) => any()},
  icon: %{
    optional(:width) => integer(),
    :url => binary(),
    optional(:height) => integer()
  },
  iframe: %{
    optional(:width) => integer(),
    optional(:height) => integer(),
    src: binary()
  },
  text: binary(),
  thumbnail: %{
    optional(:width) => integer(),
    :url => binary(),
    optional(:height) => integer()
  },
  title: binary(),
  url: binary(),
  window: %{
    optional(:width) => integer(),
    optional(:height) => integer(),
    optional(:target_name) => binary(),
    optional(:window_features) => binary()
  }
}

Functions

new(opts)

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

Create a new link content item.

Examples

iex> {:ok, link} = Ltix.DeepLinking.ContentItem.Link.new(url: "https://example.com")
iex> link.url
"https://example.com"

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