Reference

GarishPrint.GarishIOType
GarishIO{IO_t <: IO} <: IO

GarishIO contains the pretty printing preference and states.

Members

  • bland_io::IO_t: the original io.
  • indent::Int: indentation size.
  • compact::Bool: whether the printing should be compact.
  • displaysize::Tuple{Int, Int}: the terminal displaysize.
  • show_indent: print the indentation hint or not.
  • color: color preference, either ColorPreference or nothing for no color.
  • state: the state of the printer, see PrintState.
source
GarishPrint.GarishIOMethod
GarishIO(io::IO, garish_io::GarishIO; kw...)

Create a new similar GarishIO with new bland IO object io based on an existing garish io preference. The preference can be overloaded by kw. See pprint for the available keyword arguments.

source
GarishPrint.PrintTypeType
@enum PrintType

PrintType to tell lower level printing some useful context. Currently only supports Unknown and StructField.

source
GarishPrint.pprint_list_likeFunction
pprint_list_like(io::GarishIO, list, opn='[', cls=']'; compact::Bool=io.compact)

Print a list-like object list. A list-like object should support the iterable interface such as Base.iterate and Base.length. This is modified based on base/arrayshow.jl:show_vector.

Arguments

  • io::GarishIO: the GarishIO object one wants to print to.
  • list: the list-like object.
  • opn: the openning marker, default is [.
  • cls: the closing marker, default is ].

Keyword Arguments

  • compact::Bool: print the list within one line or not.
source
GarishPrint.pprint_structFunction
pprint_struct([io::IO=stdout], [mimetype], x; kw...)

Pretty print object x that is a struct type (isstructtype returns true).

Keyword Arguments

See pprint, they share the same keyword arguments.

source
GarishPrint.print_indentMethod
print_indent(io::GarishIO)

Print an indentation. This should be only used under MIME"text/plain" or equivalent.

source
GarishPrint.print_operatorMethod
print_operator(io::GarishIO, op)

Print an operator, such as =, +, => etc. This should be only used under MIME"text/plain" or equivalent.

source
GarishPrint.print_tokenMethod
print_token(f, io::GarishIO, type::Symbol, xs...)

Print xs to a GarishIO as given token type using f(io, xs...)

source
GarishPrint.print_tokenMethod
print_token(io::GarishIO, type::Symbol, xs...)

Print xs to a GarishIO as given token type. The token type should match the field name of ColorPreference.

source