Skip to content

Commit

Permalink
Expand opening section of README
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-harvey committed Feb 1, 2020
1 parent 9a5b895 commit dc4987c
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
[![Code Climate][CC img]][Code Climate]
[![Awesome][AR img]][Awesome Ruby]

Tabulo is a terminal table generator for Ruby.
Tabulo is a terminal table generator for Ruby. It is both easy to use, and feature rich.

It offers a DRY, "column-centric" interface, and is designed to make it very easy to produce highly
readable tables, even from large and unwieldy data sets and streams.
It offers a DRY, column-based interface, and is designed so that highly readable tables
can be produced with ease, even from large and unwieldy data sets and streams.

Tabulo is both easy to use and feature rich, allowing you to quickly tabulate any enumerable
collection, with options for automatic column sizing, a variety of border styles, and more.
_Quick API:_

```
> puts Tabulo::Table.new(User.all, :id, :first_name, :last_name, border: :modern).pack
Expand All @@ -25,6 +24,26 @@ collection, with options for automatic column sizing, a variety of border styles
└────┴────────────┴───────────┘
```

_Full API:_

```
table = Tabulo::Table.new(User.all, border: :modern) do |t|
t.add_column("ID", &:id)
t.add_column("First name", &:first_name)
t.add_column("Last name") { |user| user.last_name.upcase }
end
```

```
> puts table.pack
┌────┬────────────┬───────────┐
│ ID │ First name │ Last name │
├────┼────────────┼───────────┤
│ 1 │ John │ CITIZEN │
│ 2 │ Jane │ DOE │
└────┴────────────┴───────────┘
```

## Features

* Lets you set [fixed column widths](#fixed-column-widths), then either [wrap](#overflow-handling)
Expand Down

0 comments on commit dc4987c

Please sign in to comment.