Documentation.

This commit is contained in:
Gerrit Viljoen 2019-05-13 22:58:37 +02:00
parent aa8aec5063
commit 60172b9454
3 changed files with 37 additions and 2 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "ascii_table"
version = "0.1.0"
version = "0.1.1"
authors = ["Gerrit Viljoen <red.striker@protonmail.com>"]
license = "GPL-3.0+"
edition = "2018"
@ -9,6 +9,6 @@ description = "Print ASCII tables to the terminal"
repository = "https://gitlab.com/d5b4b2/ascii-table"
homepage = "https://gitlab.com/d5b4b2/ascii-table"
documentation = "https://docs.rs/ascii_table"
# readme = "readme.md"
readme = "readme.md"
categories = ["command-line-interface"]
keywords = ["ascii", "table"]

18
readme.md Normal file
View File

@ -0,0 +1,18 @@
# ascii-table
Print ASCII tables to the terminal.
## Example
```
use ascii_table::{TableConfig, print_table};
let config = TableConfig::default();
let data = vec![&[1, 2, 3], &[4, 5, 6], &[7, 8, 9]];
print_table(data, &config);
// ┌───┬───┬───┐
// │ 1 │ 2 │ 3 │
// │ 4 │ 5 │ 6 │
// │ 7 │ 8 │ 9 │
// └───┴───┴───┘
```

View File

@ -15,6 +15,23 @@
// You should have received a copy of the GNU General Public License
// along with ascii-table. If not, see <http://www.gnu.org/licenses/>.
//! Print ASCII tables to the terminal.
//!
//! # Example
//!
//! ```
//! use ascii_table::{TableConfig, print_table};
//!
//! let config = TableConfig::default();
//! let data = vec![&[1, 2, 3], &[4, 5, 6], &[7, 8, 9]];
//! print_table(data, &config);
//! // ┌───┬───┬───┐
//! // │ 1 │ 2 │ 3 │
//! // │ 4 │ 5 │ 6 │
//! // │ 7 │ 8 │ 9 │
//! // └───┴───┴───┘
//! ```
mod config;
pub use config::*;
#[cfg(test)] mod test;