Skip to content

Pretty printing in Julia without all that annoying "writing code" business

License

Notifications You must be signed in to change notification settings

curtd/AutoPrettyPrinting.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoPrettyPrinting

Stable Dev Build Status Coverage Status

The goal of AutoPrettyPrinting is to remove some of the tedium of rolling your own custom pretty printing code for your custom types. To a given object x, this package associates a horizontally-oriented layout (akin to the default Base.show layout) as well as a vertically-oriented layout. The choice of whether to use one or both of these layouts when rendering an object x is made dynamically, both by the heuristics defined in this package, as well as of the dynamic block choice given in .

AutoPrettyPrinting provides macros that enable straightforward pretty printing of custom types using PrettyPrinting.jl. Custom pretty printing code can be specified on a per-MIME type basis and, for a given type, can either be automatically generated using the @def_pprint macro or custom-provided by the user with the @custom_tile macro.

Examples

julia> using AutoPrettyPrinting

julia> struct A 
           key1::Int 
           key2::String
       end

julia> @def_pprint mime_types="text/plain" base_show=true A

julia> a = A(10, "abcd")
A(key1 = 10, key2 = abcd)

About

Pretty printing in Julia without all that annoying "writing code" business

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages