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 braces
    • key: (string) string that will be inserted before table keys
    • boolean: (string) string that will be inserted before booleans
    • string: (string) string that will be inserted before strings
    • number: (string) string that will be inserted before numbers
    • reset_color: (string) string that will be inserted after the entity which has a defined color
    (optional)

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:

generated by LDoc 1.4.6 Last updated 2021-04-22 13:57:02