scribe v0.6.0 Scribe View Source
Pretty-print tables of structs and maps
Link to this section Summary
Functions
Formats data into a printable table string
Prints a table from given data and returns the data
Prints a table from given data
Link to this section Types
Options for configuring table output.
:colorize
- Whenfalse
, disables colored output. Defaults totrue
:data
- Defines table headers:style
- Style callback module. Defaults toScribe.Style.Default
:width
- Defines table width. Defaults to:infinite
Link to this section Functions
Formats data into a printable table string.
Examples
iex> format([])
:ok
iex> format(%{test: 1234}, colorize: false)
"+---------+\n| :test |\n+---------+\n| 1234 |\n+---------+\n"
Link to this function
inspect(results, opts \\ [])
View Source
inspect(term(), format_opts()) :: term()
Prints a table from given data and returns the data.
Useful for inspecting pipe chains.
Examples
iex> Scribe.inspect([])
[]
iex> Scribe.inspect(%{key: :value, test: 1234}, colorize: false)
+----------+---------+
| :key | :test |
+----------+---------+
| :value | 1234 |
+----------+---------+
%{test: 1234, key: :value}