githubchart-rust
v5.1.4
Published
GitHub contribution graph generator in Rust/WASM
Downloads
198
Readme
GitHubChart (The Rusty Version)
Generates an SVG of your GitHub contributions:
Fork
This is forked from githubchart and ported from Ruby to Rust. It does not provide 100% of the same functionality, but it does generate a similar SVG.
Usage with cargo
If you have Rust installed and are familiar with cargo, you can install and run this directly:
cargo run -- output.svg -u frytg
This compiles and runs the program directly (using dev profile and debug symbols). This would also be the command when developing locally.
To modify the color scheme used, you can provide -c SCHEME
. For example, cargo run -- output.svg -u frytg -c halloween
uses GitHub's halloween colors.
Use cargo fmt
to format the code and cargo test
to run the tests.
Usage with binary
Alternatively, you can download a release binary from the releases page and run it directly:
./githubchart-rust output.svg -u frytg
Build
You can build a release binary with:
cargo build --release
Cargo.toml
is configured to optimize for size.
Test the binary with:
./target/release/githubchart-rust release.svg -u frytg
Build for Web
See Compiling from Rust to WebAssembly for a full guide on compiling Rust to WebAssembly (WASM).
This project is already configured to build for Web with wasm-pack
. Run this command to build:
wasm-pack build --target web
wasm-pack build --target deno --out-dir pkg-deno
or a combined version for both:
rm -rf pkg && wasm-pack build --target deno --out-name githubchart_rust_deno && wasm-pack build --target web && rm pkg/.gitignore
For the combined version, you will need to remove files
from pkg/package.json
to publish all files (web+deno) to NPM.
There's also an example in web/example.html
that you can run locally.
More docs about this:
License
This githubchart-rust
fork (like the upstream repository) is released under the MIT License. See the bundled LICENSE file for details.