IO.ANSI.Table.LineTypes (IO ANSI Table v1.0.14) View Source

Nests row line types in a reversed flat list of line types.

Link to this section Summary

Functions

Nests row line types in a reversed flat list of line types.

Link to this section Functions

Specs

Nests row line types in a reversed flat list of line types.

Examples

iex> alias IO.ANSI.Table.LineTypes
iex> types = Enum.reverse([:top, :header, :separator, :row, :bottom])
iex> LineTypes.from(types)
[:top, :header, :separator, [:row], :bottom]

iex> alias IO.ANSI.Table.LineTypes
iex> types = [:top, :header, :separator, :even_row, :odd_row, :bottom]
iex> types = Enum.reverse(types)
iex> LineTypes.from(types)
[:top, :header, :separator, [:even_row, :odd_row], :bottom]

iex> alias IO.ANSI.Table.LineTypes
iex> types = Enum.reverse([:header, :separator, :row_1, :row_2, :row_3])
iex> LineTypes.from(types)
[:header, :separator, [:row_1, :row_2, :row_3]]

iex> alias IO.ANSI.Table.LineTypes
iex> types = Enum.reverse(
...>   [:header, :separator, :row, :separator, :row_1, :row_2, :row_3]
...> )
iex> LineTypes.from(types)
[:header, :separator, [:row], :separator, [:row_1, :row_2, :row_3]]