Skip to content

Commit

Permalink
Improve library documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-leon committed May 10, 2022
1 parent 2c920dc commit 8e48cf9
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 18 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,9 @@ jobs:
${{ steps.package.outputs.PKG_PATH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to crates.io
uses: katyo/publish-crates@v1
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
args: --allow-dirty
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
0.5.2
=====

Doc improvements

0.5.0
=====

Features:

* Allow to be use the `lowcharts` as a library. See README for an example, and
documentation for API details.
* Allow to be use the `lowcharts` as a library. See README for an example. API
documentation: https://docs.rs/lowcharts/latest/lowcharts/

0.4.4
=====
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lowcharts"
version = "0.5.0"
version = "0.5.2"
authors = ["JuanLeon Lahoz <juanleon.lahoz@gmail.com>"]
edition = "2018"
description = "Tool to draw low-resolution graphs in terminal"
Expand Down
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,21 @@ of a metric over time, but not the speed of that evolution.

There is regex support for this type of plots.

### Installing

#### Via release

Go over https://github.com/juan-leon/lowcharts/releases/ and download the binary
you want. Decompress the file and copy the binary to your path.

#### Via local compilation

```
$ git clone https://github.com/juan-leon/lowcharts
$ cd lowcharts
$ cargo install --path .
```

### Using it as a library

`lowcharts` can be used as a library by any code that needs to display text
Expand Down Expand Up @@ -177,20 +192,7 @@ You can disable coloring by doing:
Paint::disable();
```

### Installing

#### Via release

Go over https://github.com/juan-leon/lowcharts/releases/ and download the binary
you want. Decompress the file and copy the binary to your path.

#### Via local compilation

```
$ git clone https://github.com/juan-leon/lowcharts
$ cd lowcharts
$ cargo install --path .
```
You can find the documentation [here](https://docs.rs/lowcharts/latest/lowcharts/).

### Contributing

Expand Down
17 changes: 17 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
//! # Getting Started
//! Add the following to your `Cargo.toml`:
//! ```toml
//! [dependencies]
//! lowcharts = "*"
//! ```
//!
//! ```rust,no_run
//! use lowcharts::plot;
//!
//! let vec = &[-1.0, -1.1, 2.0, 2.0, 2.1, -0.9, 11.0, 11.2, 1.9, 1.99];
//! // Plot a histogram of the above vector, with 4 buckets and a precision
//! // choosen by library
//! let histogram = plot::Histogram::new(vec, 4, None);
//! print!("{}", histogram);
//! ```
mod format;
pub mod plot;
pub mod stats;

0 comments on commit 8e48cf9

Please sign in to comment.