Skip to content

Commit a272a37

Browse files
committed
Updated docs
1 parent 7556e05 commit a272a37

File tree

4 files changed

+60
-30
lines changed

4 files changed

+60
-30
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
*.swo
33
*~
44
*.log
5-
node_modules
5+
node_modules

CONTRIBUTING.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ Contributions are more than welcome!
5959

6060
Thanks! :sweat_smile:
6161

62+
63+
6264
[1]: https://github.com/IonicaBizau/git-stats/issues
6365

64-
[2]: https://github.com/IonicaBizau/code-style
66+
[2]: https://github.com/IonicaBizau/code-style

DOCUMENTATION.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
## Documentation
2+
23
You can see below the API reference of this module.
34

45
### `GitStats(dataPath)`
@@ -142,3 +143,18 @@ Creates the authors pie.
142143
#### Return
143144
- **GitStats** The `GitStats` instance.
144145

146+
### `globalActivity(options, callback)`
147+
Creates the global contributions calendar (all commits made by all committers).
148+
149+
#### Params
150+
- **String|Object** `options`: The repo path or an object containing the following fields:
151+
- `repo` (String): The repository path.
152+
- `start` (String): The start date.
153+
- `end` (String): The end date.
154+
- `theme` (String|Object): The calendar theme.
155+
- `raw` (Boolean): If `true`, the raw JSON will be displayed.
156+
- **Function** `callback`: The callback function.
157+
158+
#### Return
159+
- **GitStats** The `GitStats` instance.
160+

README.md

+40-28
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
12
[![git-stats](http://i.imgur.com/Q7TQYHx.png)](#)
23

34
# `$ 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)
45

56
> Local git statistics including GitHub-like contributions calendars.
67
8+
79
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:
810

911
![](http://i.imgur.com/PpM0i3v.png)
@@ -12,49 +14,53 @@ I'd be curious to see your calendar with all your commits. Ping me on Twitter ([
1214

1315
- [Installation](#installation)
1416
- [Usage](#usage)
15-
17+
1618
- [Importing and deleting commits](#importing-and-deleting-commits)
1719
- [Importing all the commits from GitHub and BitBucket](#importing-all-the-commits-from-github-and-bitbucket)
1820
- [What about the GitHub Contributions calendar?](#what-about-the-github-contributions-calendar)
19-
21+
2022
- [Documentation](#documentation)
2123
- [How to contribute](#how-to-contribute)
2224

23-
## Installation
25+
26+
## :cloud: Installation
2427

2528
You can install the package globally and use it as command line tool:
2629

27-
```sh
30+
31+
```sh
2832
# Install the package globally
2933
npm i -g git-stats
3034
# Initialize git hooks
3135
# This is for tracking the new commits
3236
curl -s https://raw.githubusercontent.com/IonicaBizau/git-stats/master/scripts/init-git-post-commit | bash
3337
```
3438
39+
3540
Then, run `git-stats --help` and see what the CLI tool can do.
3641
37-
```sh
42+
43+
```
3844
$ git-stats --help
3945
Usage: git-stats [options]
4046

4147
Options:
42-
-s, --since <date> Optional start date.
43-
-u, --until <date> Optional end date.
44-
-n, --no-ansi Forces the tool not to use ANSI styles.
45-
-l, --light Enables the light theme.
46-
-a, --authors Shows a pie chart with the author related
47-
contributions in the current repository.
48-
-g, --global-activity Shows global activity calendar in the current
49-
repository.
50-
-d, --data <path> Sets a custom data store file.
51-
-f, --first-day <day> Sets the first day of the week.
52-
--record <data> Records a new commit. Don't use this unless you
48+
-s, --since <date> Optional start date.
49+
-u, --until <date> Optional end date.
50+
-n, --no-ansi Forces the tool not to use ANSI styles.
51+
-l, --light Enables the light theme.
52+
-a, --authors Shows a pie chart with the author related
53+
contributions in the current repository.
54+
-g, --global-activity Shows global activity calendar in the current
55+
repository.
56+
-d, --data <path> Sets a custom data store file.
57+
-f, --first-day <day> Sets the first day of the week.
58+
--record <data> Records a new commit. Don't use this unless you
5359
are a mad scientist. If you are a developer, just
54-
use this option as part of the module.
55-
-r, --raw Outputs a dump of the raw JSON data.
56-
-h, --help Displays this help.
57-
-v, --version Displays version information.
60+
use this option as part of the module.
61+
-r, --raw Outputs a dump of the raw JSON data.
62+
-h, --help Displays this help.
63+
-v, --version Displays version information.
5864

5965
Examples:
6066
git-stats # Default behavior (stats in the last year)
@@ -167,14 +173,18 @@ If you run `git-stats` to display graph on Windows, please use a terminal that c
167173

168174
Cygwin Terminal is known to work, while Windows Command Prompt and Git Bash do not. Improvements are more than welcome! :dizzy:
169175

170-
## Example
176+
177+
## :clipboard: Example
178+
171179

172180
Here is an example how to use this package as library. To install it locally, as library, you can do that using `npm`:
173181

174182
```sh
175183
$ npm i --save git-stats
176184
```
177185

186+
187+
178188
```js
179189
// Dependencies
180190
var GitStats = require("git-stats");
@@ -190,23 +200,25 @@ g1.ansiCalendar({
190200
});
191201
```
192202

193-
## Documentation
203+
## :memo: Documentation
194204

195205
For full API reference, see the [DOCUMENTATION.md][docs] file.
196206

197-
## Press Highlights
207+
## :newspaper: Press Highlights
198208

199209
- [*A GitHub-like contributions calendar, but locally, with all your git commits*, The Changelog](https://changelog.com/github-like-contributions-calendar-locally-git-commits/)
200210

201-
## How to contribute
211+
212+
## :yum: How to contribute
202213
Have an idea? Found a bug? See [how to contribute][contributing].
203214

204-
## Where is this library used?
215+
## :dizzy: Where is this library used?
205216
If you are using this library in one of your projects, add it in this list. :sparkles:
206217

207-
- [`git-stats-importer`](https://github.com/IonicaBizau/git-stats-importer)
208218

209-
## License
219+
- [`git-stats-importer`](https://github.com/IonicaBizau/git-stats-importer)—Imports your commits from a repository into git-stats history.
220+
221+
## :scroll: License
210222

211223
[MIT][license] © [Ionică Bizău][website]
212224

@@ -216,4 +228,4 @@ If you are using this library in one of your projects, add it in this list. :spa
216228
[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
217229
[website]: http://ionicabizau.net
218230
[contributing]: /CONTRIBUTING.md
219-
[docs]: /DOCUMENTATION.md
231+
[docs]: /DOCUMENTATION.md

0 commit comments

Comments
 (0)