Otzel.Op.Insert (otzel v0.3.2)
View SourceAn operation that inserts new content at the current position.
Insert operations are the building blocks of documents in the delta format. A document is represented as a list of insert operations.
Fields
:content- The content to insert (string or embedded content):attrs- Optional map of formatting attributes
Examples
# Plain text insert
%Otzel.Op.Insert{content: "Hello", attrs: nil}
# Insert with formatting
%Otzel.Op.Insert{content: "Bold", attrs: %{"bold" => true}}
# Using helper function
Otzel.insert("Hello")
Otzel.insert("Bold", %{"bold" => true})
Summary
Functions
Callback implementation for Otzel.Op.merge_into/2.
Callback implementation for Otzel.Op.size/1.
Callback implementation for Otzel.Op.take/2.
Types
@type t() :: %Otzel.Op.Insert{attrs: Otzel.Attrs.t(), content: Otzel.Content.t()}
Functions
Callback implementation for Otzel.Op.merge_into/2.
Callback implementation for Otzel.Op.size/1.
Callback implementation for Otzel.Op.take/2.