Skip to content

Commit

Permalink
Fix README.md (#403)
Browse files Browse the repository at this point in the history
* Rename ExtendedTable example in README

* Fix toc

* Fix typos
  • Loading branch information
akiomik authored Jun 12, 2024
1 parent e7a1368 commit 601aa3c
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ you can find more examples in an **[examples](/tabled/examples/)** folder.
- [`IterTable`](#itertable)
- [`CompactTable`](#compacttable)
- [`PoolTable`](#pooltable)
- [`ExpandedDisplay`](#expanded-display)
- [Tips & Tricks](#tips-&-tricks)
- [`ExtendedTable`](#extendedtable)
- [Tips and Tricks](#tips-and-tricks)
- [`std::fmt::*` options](#std::fmt::*-options)
- [Tuple combination](#tuple-combination)
- [Object](#object)
Expand Down Expand Up @@ -117,7 +117,7 @@ To print a list of structs or enums as a table, there is 2 ways.
* Implement a `Tabled` trait for your type (or anotate your type with a derive macro) and use a iterator of this type.

A builder method gets handy, when a data schema is unknown,\
while a typped struct in cases where we know the data structure beforehand.
while a typed struct in cases where we know the data structure beforehand.

Notice that there are a lot of [*mods*](#settings) available for your tables.
As well as the helpers such as [*derive macros*](#derive) and [*proc macros*](#macros).
Expand Down Expand Up @@ -411,7 +411,7 @@ The style will look like the following for the first example.
Also you can build your own one from scratch, and doing so not always possible at compile time,
so you may use `Theme` object to do that.

Notice that the `Theme` is quite powerfull on itself, you can check it in the [documentation](https://docs.rs/tabled/latest/tabled/settings/struct.Theme.html).
Notice that the `Theme` is quite powerful on itself, you can check it in the [documentation](https://docs.rs/tabled/latest/tabled/settings/struct.Theme.html).

```rust
use tabled::grid::config::{Border, HorizontalLine};
Expand Down Expand Up @@ -1406,7 +1406,7 @@ println!("{}", table);
### Split

You can `Split` a table on a row or column to redistribute the cells beyond that point
into a new shape with the provided point acting as the new, upper boundry in the direction selected.
into a new shape with the provided point acting as the new, upper boundary in the direction selected.

Adding this to a first example will result in the next table.

Expand Down Expand Up @@ -1676,7 +1676,7 @@ struct Bike {

## Table types

`tabled` has a few representations of tables some differs from it's view some from it's implememtation details.
`tabled` has a few representations of tables some differs from it's view some from it's implementation details.

There are situations when you might better use one but not another.
But sometimes some can be used interchangable.
Expand All @@ -1690,17 +1690,17 @@ It's implemenentation requires that all data be stored on heap.

### `IterTable`

It's simmilar to main `Table`, it's only difference is that it does not require a the whole buffer.
It's similar to main `Table`, it's only difference is that it does not require a the whole buffer.
It only requires a buffer for 1 row at a time.

It might be usefull when you can't fit all your data in memory.
It might be useful when you can't fit all your data in memory.

### `CompactTable`

Simmular to `IterTable` but it might not require any buffer.
Similar to `IterTable` but it might not require any buffer.
It also has capability for a sniffing logic, where we estimate data dimension on a small selection of data.

It might be usefull in a very constrain environments.
It might be useful in a very constrain environments.
It is the only table which supports `no-std`.

### `PoolTable`
Expand Down Expand Up @@ -1747,14 +1747,14 @@ The output would look like the following.
:...............:.................:
```

### `ExpandedDisplay`
### `ExtendedTable`

You can use `ExpandedDisplay` if your data structure has a lot of fields.
You can use `ExtendedTable` if your data structure has a lot of fields.

Here's an example.

```rust
use tabled::{display::ExpandedDisplay, Tabled};
use tabled::{tables::ExtendedTable, Tabled};

#[derive(Tabled)]
struct Distribution {
Expand All @@ -1781,7 +1781,7 @@ let data = [
},
];

let table = ExpandedDisplay::new(&data);
let table = ExtendedTable::new(&data);

println!("{}", table);
```
Expand All @@ -1803,7 +1803,7 @@ is_active | true
is_cool | true
```

## Tips & Tricks
## Tips and Tricks

### `std::fmt::*` options

Expand Down Expand Up @@ -1927,7 +1927,7 @@ table.with(Modify::new(ByColumnName::new("name")).with(Alignment::center()));

### Builder

`Builder` is a powerfull tool you shall be aware of.
`Builder` is a powerful tool you shall be aware of.

For example you can use `Builder::index` to make a particular column an index,
which will stay on the left.
Expand Down Expand Up @@ -2178,7 +2178,7 @@ As you can see Github tricks a bit a return table, but `GNOME terminal` and `Ala

### Terminal size

It's a frequent case where it's nessary to align a table to a terminal width or height.
It's a frequent case where it's necessary to align a table to a terminal width or height.
You can achieve that by using `Width` and `Height`.
You can peak a strategy by which a column/row truncation/widening will be done by using `Priority`.

Expand Down

0 comments on commit 601aa3c

Please sign in to comment.