#pretty #format #pretty-print #print #beautify #data-structures

layouts

Conveniently lay out and format your data structures, and decide how to render them separately

1 unstable release

0.1.0 Sep 28, 2021

#251 in Value formatting

ISC OR Apache-2.0

25KB
734 lines

This crate is currently a work in progress, and doesn't yet have great API entry points, nor very good documentation. Both are forthcoming.

layouts helps you lay out and format your data structures, and decide how to render them separately.

This allows you to describe the full structure up front, and deal with the width of your terminal separately.

It will also turn any Rust data structure that supports Serialize into a pretty-printable document that can be rendered using layouts with zero configuration.

TODO: Pluggable Renderers

Right now, the only thing layouts allows you to configure when rendering is the width of the terminal.

Eventually, this library aspires to offer pluggable renderers that can support:

  • describing your data structures with styles, which can then be separately rendered into colors, or with no color
  • HTML rendering (with streaming and collapsing)
  • and more (see TODO.md for more details)

Dependencies

~3MB
~60K SLoC