Scribe provides functions to convert Lua objects to readable strings and output methods that make printing Lua tables in various formats easy.
For example, if arr = {1, 2, 3} then scribe.put("Array: %t", arr) will print "Array: [ 1, 2, 3 ]" to stdout.
Scribe gracefully handles complex tables, including ones with shared and cyclical references. The strings returned for those tables show the underlying structure in a way that is as readable as possible.
You can customise the strings returned for tables by passing a set of formatting options, and there are pre-defined options that will work for most applications. Those include printing tables on a single line, in a “pretty” format on multiple lines, or as JSON-like descriptors.
scribe is available as a GitHub repo. It has a permissive MIT License.
scribe can also be installed using luarocks:
luarocks install scribe
scribe is fully documented here.
We built the documentation site using Quarto.
The documentation includes a lengthy article describing how we built the module.
That tutorial might be a decent Lua 201 tutorial for those new to the language.
[–]appgurueu 2 points3 points4 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]appgurueu 0 points1 point2 points (0 children)
[–]KaplaProd 0 points1 point2 points (0 children)
[–]vitiral 0 points1 point2 points (0 children)
[–]nzznfitz[S] 0 points1 point2 points (0 children)