diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 69257c3..bc042d9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a0733e..2d1fd92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ===== diff --git a/Cargo.lock b/Cargo.lock index ccd7b29..53f971f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -301,7 +301,7 @@ dependencies = [ [[package]] name = "lowcharts" -version = "0.5.0" +version = "0.5.2" dependencies = [ "assert_cmd", "atty", diff --git a/Cargo.toml b/Cargo.toml index 0e2ebe1..3ec12b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lowcharts" -version = "0.5.0" +version = "0.5.2" authors = ["JuanLeon Lahoz "] edition = "2018" description = "Tool to draw low-resolution graphs in terminal" diff --git a/README.md b/README.md index 0794653..87269b5 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/src/lib.rs b/src/lib.rs index 428bed0..edaf7cf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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;