scribe v0.8.1 Scribe View Source
Pretty-print tables of structs and maps
Link to this section Summary
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
Enables/disables auto-inspect override.
If true, Scribe will override inspect/2
for maps and structs, printing
them as tables.
Examples
iex> Scribe.auto_inspect(true)
:ok
Returns true if Scribe is overriding Inspect
.
Examples
iex> Scribe.auto_inspect?
true
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}