lazytable 0.1.0

lazy tables with stupid wrapping
Documentation
  • Coverage
  • 77.78%
    7 out of 9 items documented2 out of 9 items with examples
  • Size
  • Source code size: 13.47 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.7 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • fiji-flo/lazytable
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • fiji-flo

lazy tables with stuipd wrapping

Travis Build Status Latest Version


Getting Started

Add the following dependency to your Cargo manifest…

[dependencies]
lazytable = "0.1"

and look at the docs:

Example

#[macro_use]
extern crate lazytable;
use lazytable::Table;

fn main() {
    let mut table = Table::with_width(23);
    table.set_title(row!["who", "what", "when"]);
    table.add_row(row!["da", "foobar foobar", "bar"]);
    table.add_row(row!["da", "foobar!!", "bar"]);
    print!("{}", table);
}

This will output:

 who | what     | when
-----|----------|------
 da  | foobar   | bar
     | foobar   |
 da  | foobar!! | bar

Why?

prettytable is awesome. But wrapping in a teminal is no fun.

What can it do?

For now lazytable only produces a simple table like this (given a terminal width of 20):

Given width of 20:

######################
# da | foobar  | bar #
#    | foobar  |     #
# da | foobar! | bar #
######################

Without a width or with prettytable:

######################
# da | foobar foobar #
#| bar               #
# da | foobar! | bar #
######################

TODO

  • clean up code
  • make it configuarable to some extend
  • write proper doc