Pane v0.1.0 Pane.Page

Summary

Functions

Constructs new Pane.Page given data and index

Splits data on the newline and chunks it into Pane.Page structs

Types

t()
t() :: %Pane.Page{data: String.t, index: pos_integer}

Functions

new(data, index)
new(String.t, pos_integer) :: t

Constructs new Pane.Page given data and index.

Examples

iex> Pane.Page.new("test", 1)
%Pane.Page{data: "test", index: 1}
paginate(data, max_lines \\ 50)
paginate(String.t, pos_integer) :: [t]

Splits data on the newline and chunks it into Pane.Page structs.

Examples

iex> [p1] = Enum.join(1..4, "\n") |> Pane.Page.paginate
iex> p1.index
0
iex> p1.data
"1\n2\n3\n4"