Updated docs

This commit is contained in:
Ionică Bizău 2016-04-26 07:55:05 +03:00
parent 7556e054d9
commit a272a376db
4 changed files with 60 additions and 30 deletions

View file

@ -59,6 +59,8 @@ Contributions are more than welcome!
Thanks! :sweat_smile:
[1]: https://github.com/IonicaBizau/git-stats/issues
[2]: https://github.com/IonicaBizau/code-style

View file

@ -1,4 +1,5 @@
## Documentation
You can see below the API reference of this module.
### `GitStats(dataPath)`
@ -142,3 +143,18 @@ Creates the authors pie.
#### Return
- **GitStats** The `GitStats` instance.
### `globalActivity(options, callback)`
Creates the global contributions calendar (all commits made by all committers).
#### Params
- **String|Object** `options`: The repo path or an object containing the following fields:
- `repo` (String): The repository path.
- `start` (String): The start date.
- `end` (String): The end date.
- `theme` (String|Object): The calendar theme.
- `raw` (Boolean): If `true`, the raw JSON will be displayed.
- **Function** `callback`: The callback function.
#### Return
- **GitStats** The `GitStats` instance.

View file

@ -1,9 +1,11 @@
[![git-stats](http://i.imgur.com/Q7TQYHx.png)](#)
# `$ git-stats` [![PayPal](https://img.shields.io/badge/%24-paypal-f39c12.svg)][paypal-donations] [![Version](https://img.shields.io/npm/v/git-stats.svg)](https://www.npmjs.com/package/git-stats) [![Downloads](https://img.shields.io/npm/dt/git-stats.svg)](https://www.npmjs.com/package/git-stats) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
> Local git statistics including GitHub-like contributions calendars.
I'd be curious to see your calendar with all your commits. Ping me on Twitter ([**@IonicaBizau**](https://twitter.com/IonicaBizau)). :smile: Until then, here's my calendar:
![](http://i.imgur.com/PpM0i3v.png)
@ -20,10 +22,12 @@ I'd be curious to see your calendar with all your commits. Ping me on Twitter ([
- [Documentation](#documentation)
- [How to contribute](#how-to-contribute)
## Installation
## :cloud: Installation
You can install the package globally and use it as command line tool:
```sh
# Install the package globally
npm i -g git-stats
@ -32,9 +36,11 @@ npm i -g git-stats
curl -s https://raw.githubusercontent.com/IonicaBizau/git-stats/master/scripts/init-git-post-commit | bash
```
Then, run `git-stats --help` and see what the CLI tool can do.
```sh
```
$ git-stats --help
Usage: git-stats [options]
@ -167,7 +173,9 @@ If you run `git-stats` to display graph on Windows, please use a terminal that c
Cygwin Terminal is known to work, while Windows Command Prompt and Git Bash do not. Improvements are more than welcome! :dizzy:
## Example
## :clipboard: Example
Here is an example how to use this package as library. To install it locally, as library, you can do that using `npm`:
@ -175,6 +183,8 @@ Here is an example how to use this package as library. To install it locally, as
$ npm i --save git-stats
```
```js
// Dependencies
var GitStats = require("git-stats");
@ -190,23 +200,25 @@ g1.ansiCalendar({
});
```
## Documentation
## :memo: Documentation
For full API reference, see the [DOCUMENTATION.md][docs] file.
## Press Highlights
## :newspaper: Press Highlights
- [*A GitHub-like contributions calendar, but locally, with all your git commits*, The Changelog](https://changelog.com/github-like-contributions-calendar-locally-git-commits/)
## How to contribute
## :yum: How to contribute
Have an idea? Found a bug? See [how to contribute][contributing].
## Where is this library used?
## :dizzy: Where is this library used?
If you are using this library in one of your projects, add it in this list. :sparkles:
- [`git-stats-importer`](https://github.com/IonicaBizau/git-stats-importer)
## License
- [`git-stats-importer`](https://github.com/IonicaBizau/git-stats-importer)—Imports your commits from a repository into git-stats history.
## :scroll: License
[MIT][license] © [Ionică Bizău][website]