GtBridge.Phlow.Text (gt_bridge v0.17.2)

Copy Markdown View Source

A Phlow text editor view specification.

Text views display textual content in GT's inspector.

Summary

Functions

Convert the text view to a dictionary format for serialization to GT.

Set the font size.

I mark the text as markdown. GT renders with LeTextSnippet.

Set the text to use glamorousCodeFont (monospaced).

Set the text content to display.

Set the title of the view.

Types

t()

@type t() :: %GtBridge.Phlow.Text{
  font_size: pos_integer() | nil,
  markdown: boolean(),
  monospace: boolean(),
  text_string: String.t(),
  view_priority: integer(),
  view_title: String.t()
}

Functions

as_dict(self)

@spec as_dict(t()) :: map()

Convert the text view to a dictionary format for serialization to GT.

font_size(self, size)

@spec font_size(t(), pos_integer()) :: t()

Set the font size.

markdown(self)

@spec markdown(t()) :: t()

I mark the text as markdown. GT renders with LeTextSnippet.

monospace(self)

@spec monospace(t()) :: t()

Set the text to use glamorousCodeFont (monospaced).

priority(self, priority_value)

@spec priority(t(), integer()) :: t()

string(self, text)

@spec string(t(), String.t() | (-> String.t())) :: t()

Set the text content to display.

title(self, title_text)

@spec title(t(), String.t()) :: t()

Set the title of the view.