Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
IonicaBizau committed Apr 26, 2016
1 parent 7556e05 commit a272a37
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
*.swo
*~
*.log
node_modules
node_modules
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Documentation

You can see below the API reference of this module.

### `GitStats(dataPath)`
Expand Down Expand Up @@ -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.

68 changes: 40 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -12,49 +14,53 @@ 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
# This is for tracking the new commits
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)
Expand Down Expand Up @@ -167,14 +173,18 @@ 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`:

```sh
$ npm i --save git-stats
```



```js
// Dependencies
var GitStats = require("git-stats");
Expand All @@ -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]

Expand All @@ -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

0 comments on commit a272a37

Please sign in to comment.