Module lua-nucleo.tpretty
Pretty visualization of non-recursive tables.
This file is a part of lua-nucleo library
Info:
- Copyright: lua-nucleo authors (see file
COPYRIGHT
for the license)
Functions
tpretty_ex (iterator, t[, indent=' '[, cols=80[, colors]]]) | Generate pretty representation of the table t . |
tpretty (t[, indent=' '[, cols=80[, colors]]]) | Generate pretty representation of the table t using pairs iterator for
traversing the table. |
tpretty_ordered (t[, indent=' '[, cols=80[, colors]]]) | Generate pretty representation of the table t using
tdeepequals.ordered_pairs
iterator for traversing the table. |
Functions
- tpretty_ex (iterator, t[, indent=' '[, cols=80[, colors]]])
-
Generate pretty representation of the table
t
.Parameters:
- iterator function Iterator to be used when traversing the table.
- t table Table to render.
- indent string An indent string to be used. (default ' ')
- cols number Maximum allowed length of single line. (default 80)
- colors
table
Optional color table. Specify if you want to
define custom colors for various element of the output. Note:
reset_color
must always be specified. Available elements:curly_braces:
(string) string that will be inserted before curly braceskey:
(string) string that will be inserted before table keysboolean:
(string) string that will be inserted before booleansstring:
(string) string that will be inserted before stringsnumber:
(string) string that will be inserted before numbersreset_color:
(string) string that will be inserted after the entity which has a defined color
Returns:
-
string
Prettified representation of the table.
- tpretty (t[, indent=' '[, cols=80[, colors]]])
-
Generate pretty representation of the table
t
using pairs iterator for traversing the table.Parameters:
- t table Table to render.
- indent string An indent string to be used. (default ' ')
- cols number Maximum allowed length of single line. (default 80)
- colors table Optional color table. See tpretty_ex for details. (optional)
Returns:
-
string
Prettified representation of the table.
- tpretty_ordered (t[, indent=' '[, cols=80[, colors]]])
-
Generate pretty representation of the table
t
using tdeepequals.ordered_pairs iterator for traversing the table.Parameters:
- t table Table to render.
- indent string An indent string to be used. (default ' ')
- cols number Maximum allowed length of single line. (default 80)
- colors table Optional color table. See tpretty_ex for details. (optional)
Returns:
-
string
Prettified representation of the table.
See also: