Provides a function that indents and pretty prints data structures
Project description
iprint
iprint is a simple package that prints basic data structures in an indented and readable way. It supports changing the indent size and expansion threshold, as well as all vanilla print
arguments. The included iformat
function provides more customization, and returns a string that has been indented and formatted. An .iformat
method (returning a string) can be added to any class for that class to be printed with custom formatting.
Parameters:
indentDepth
:
Specifies how many spaces should be inserted as one indent level. Default 4
.
expansionThreshold
:
Specifies how long an object must be when printed before it is shown in a muilti-line format. Default 10
.
Ex:
iprint([1, 2, 3], expansionThreshold = 10)
# [1, 2, 3]
iprint([1, 2, 3], expansionThreshold = 8)
# [
# 1,
# 2,
# 3
# ]
indentLevel
: (iformat
only)
Specifies the indent level of the returned output string. Default 0
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.