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

2
.gitignore vendored
View file

@ -2,4 +2,4 @@
*.swo
*~
*.log
node_modules
node_modules

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
[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)
@ -12,19 +14,21 @@ I'd be curious to see your calendar with all your commits. Ping me on Twitter ([
- [Installation](#installation)
- [Usage](#usage)
- [Importing and deleting commits](#importing-and-deleting-commits)
- [Importing all the commits from GitHub and BitBucket](#importing-all-the-commits-from-github-and-bitbucket)
- [What about the GitHub Contributions calendar?](#what-about-the-github-contributions-calendar)
- [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
```sh
# Install the package globally
npm i -g git-stats
# Initialize git hooks
@ -32,29 +36,31 @@ 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]
Options:
-s, --since <date> Optional start date.
-u, --until <date> Optional end date.
-n, --no-ansi Forces the tool not to use ANSI styles.
-l, --light Enables the light theme.
-a, --authors Shows a pie chart with the author related
contributions in the current repository.
-g, --global-activity Shows global activity calendar in the current
repository.
-d, --data <path> Sets a custom data store file.
-f, --first-day <day> Sets the first day of the week.
--record <data> Records a new commit. Don't use this unless you
-s, --since <date> Optional start date.
-u, --until <date> Optional end date.
-n, --no-ansi Forces the tool not to use ANSI styles.
-l, --light Enables the light theme.
-a, --authors Shows a pie chart with the author related
contributions in the current repository.
-g, --global-activity Shows global activity calendar in the current
repository.
-d, --data <path> Sets a custom data store file.
-f, --first-day <day> Sets the first day of the week.
--record <data> Records a new commit. Don't use this unless you
are a mad scientist. If you are a developer, just
use this option as part of the module.
-r, --raw Outputs a dump of the raw JSON data.
-h, --help Displays this help.
-v, --version Displays version information.
use this option as part of the module.
-r, --raw Outputs a dump of the raw JSON data.
-h, --help Displays this help.
-v, --version Displays version information.
Examples:
git-stats # Default behavior (stats in the last year)
@ -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]
@ -216,4 +228,4 @@ If you are using this library in one of your projects, add it in this list. :spa
[license]: http://showalicense.com/?fullname=Ionic%C4%83%20Biz%C4%83u%20%3Cbizauionica%40gmail.com%3E%20(http%3A%2F%2Fionicabizau.net)&year=2015#license-mit
[website]: http://ionicabizau.net
[contributing]: /CONTRIBUTING.md
[docs]: /DOCUMENTATION.md
[docs]: /DOCUMENTATION.md