Browse Source

Improve library documentation

pull/2/head v0.5.2
JuanLeon Lahoz 4 years ago
parent
commit
8e48cf9ae7
  1. 6
      .github/workflows/release.yml
  2. 9
      CHANGELOG.md
  3. 2
      Cargo.lock
  4. 2
      Cargo.toml
  5. 30
      README.md
  6. 17
      src/lib.rs

6
.github/workflows/release.yml

@ -116,3 +116,9 @@ jobs:
${{ steps.package.outputs.PKG_PATH }} ${{ steps.package.outputs.PKG_PATH }}
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 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
CHANGELOG.md

@ -1,10 +1,15 @@
0.5.2
=====
Doc improvements
0.5.0 0.5.0
===== =====
Features: Features:
* Allow to be use the `lowcharts` as a library. See README for an example, and * Allow to be use the `lowcharts` as a library. See README for an example. API
documentation for API details. documentation: https://docs.rs/lowcharts/latest/lowcharts/
0.4.4 0.4.4
===== =====

2
Cargo.lock generated

@ -301,7 +301,7 @@ dependencies = [
[[package]] [[package]]
name = "lowcharts" name = "lowcharts"
version = "0.5.0" version = "0.5.2"
dependencies = [ dependencies = [
"assert_cmd", "assert_cmd",
"atty", "atty",

2
Cargo.toml

@ -1,6 +1,6 @@
[package] [package]
name = "lowcharts" name = "lowcharts"
version = "0.5.0" version = "0.5.2"
authors = ["JuanLeon Lahoz <juanleon.lahoz@gmail.com>"] authors = ["JuanLeon Lahoz <juanleon.lahoz@gmail.com>"]
edition = "2018" edition = "2018"
description = "Tool to draw low-resolution graphs in terminal" description = "Tool to draw low-resolution graphs in terminal"

30
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. 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 ### Using it as a library
`lowcharts` can be used as a library by any code that needs to display text `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(); Paint::disable();
``` ```
### Installing You can find the documentation [here](https://docs.rs/lowcharts/latest/lowcharts/).
#### 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 .
```
### Contributing ### Contributing

17
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; mod format;
pub mod plot; pub mod plot;
pub mod stats; pub mod stats;

Loading…
Cancel
Save