IO.ANSI.Table.Spec.Headings (IO ANSI Table v1.0.14) View Source

Derives the headings of a table.

Link to this section Summary

Functions

Derives the headings of a table.

Link to this section Functions

Specs

Derives the headings of a table.

Examples

iex> alias IO.ANSI.Table.Spec.Headings
iex> alias IO.ANSI.Table.Spec
iex> spec = Spec.new([:c4, :c1, :c2], sort_specs: [:c4])
iex> %Spec{headings: headings} = Headings.derive(spec)
iex> headings
["C4↑", "C1", "C2"]

iex> alias IO.ANSI.Table.Spec.Headings
iex> alias IO.ANSI.Table.Spec
iex> spec = Spec.new(
...>   ["station_id", "wind_mph"],
...>   sort_specs: ["station_id"],
...>   header_fixes: %{"Id" => "ID", "Mph" => "MPH"}
...> )
iex> %Spec{headings: headings} = Headings.derive(spec)
iex> headings
["Station ID↑", "Wind MPH"]