PPrinter

data class PPrinter(val defaultWidth: Int = 100, val defaultHeight: Int = 500, val defaultIndent: Int = 2, val defaultEscapeUnicode: Boolean = false, val defaultShowFieldNames: Boolean = true, val colorLiteral: Attrs = FansiColor.Green, val colorApplyPrefix: Attrs = FansiColor.Yellow, val showGenericForCollections: Boolean = true) : Walker

Parameters

defaultWidth

How wide to allow a pretty-printed value to become before wrapping

defaultHeight

How tall to allow the pretty-printed output to become before truncated it with a ...

defaultIndent

How many spaces to indent each nested [Tree.Apply] by

colorLiteral

What color to assign to literals like "lol" or 31337

colorApplyPrefix

What color to assign to Foo in Foo(bar, baz)

additionalHandlers

Provide this to override how certain types are pretty-printed at runtime

Constructors

Link copied to clipboard
constructor(defaultWidth: Int = 100, defaultHeight: Int = 500, defaultIndent: Int = 2, defaultEscapeUnicode: Boolean = false, defaultShowFieldNames: Boolean = true, colorLiteral: Attrs = FansiColor.Green, colorApplyPrefix: Attrs = FansiColor.Yellow, showGenericForCollections: Boolean = true)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val defaultHeight: Int = 500
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val defaultWidth: Int = 100
Link copied to clipboard
open override val showGenericForCollections: Boolean = true
Link copied to clipboard

Functions

Link copied to clipboard
operator fun invoke(x: Any?, width: Int = defaultWidth, height: Int = defaultHeight, indent: Int = defaultIndent, initialOffset: Int = 0, escapeUnicode: Boolean = defaultEscapeUnicode, showFieldNames: Boolean = defaultShowFieldNames): Str

Converts an [Any] into a large colored Str

Link copied to clipboard
fun <T> pprintln(x: T, width: Int = defaultWidth, height: Int = defaultHeight, indent: Int = defaultIndent, initialOffset: Int = 0, escapeUnicode: Boolean = defaultEscapeUnicode, showFieldNames: Boolean = defaultShowFieldNames)

Converts an [Any] into a large colored Str

Link copied to clipboard
fun tokenize(x: Any?, width: Int = defaultWidth, height: Int = defaultHeight, indent: Int = defaultIndent, initialOffset: Int = 0, escapeUnicode: Boolean = defaultEscapeUnicode, showFieldNames: Boolean = defaultShowFieldNames): Iterator<Str>

Converts an [Any] into an iterator of colored chunks, wrapped at a certain width and truncated at a certain height

Link copied to clipboard
fun treeify(x: Any?, escapeUnicode: Boolean, showFieldNames: Boolean): Tree