Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
IonicaBizau committed Sep 8, 2017
1 parent e67e4ad commit 66d63af
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
*~
*.log
node_modules
*.env
.DS_Store
package-lock.json
14 changes: 14 additions & 0 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ You can see below the API reference of this module.
### `GitStats(dataPath)`

#### Params

- **String** `dataPath`: Path to the data file.

#### Return
Expand All @@ -14,6 +15,7 @@ You can see below the API reference of this module.
Fetches the configuration object from file (`~/.git-stats-config.js`).

#### Params

- **Function** `callback`: The callback function.

#### Return
Expand All @@ -23,13 +25,15 @@ Fetches the configuration object from file (`~/.git-stats-config.js`).
Inits the configuration field (`this.config`).

#### Params

- **Object|String** `input`: The path to a custom git-stats configuration file or the configuration object.
- **Function** `callback`: The callback function.

### `record(data, callback)`
Records a new commit.

#### Params

- **Object** `data`: The commit data containing:
- `date` (String|Date): The date object or a string in a format that can be parsed.
- `url` (String): The repository remote url.
Expand All @@ -46,6 +50,7 @@ removeCommit
Deletes a specifc commit from the history.

#### Params

- **Object** `data`: The commit data containing:
- `date` (String|Date): The date object or a string in a format that can be parsed. If not provided, the hash object will be searched in all dates.
- `hash` (String): The commit hash.
Expand All @@ -60,6 +65,7 @@ Deletes a specifc commit from the history.
Gets the git stats.

#### Params

- **Function** `callback`: The callback function.

#### Return
Expand All @@ -69,6 +75,7 @@ Gets the git stats.
Saves the provided stats.

#### Params

- **Object** `stats`: The stats to be saved.
- **Function** `callback`: The callback function.

Expand All @@ -79,6 +86,7 @@ Saves the provided stats.
Iterate through the days, calling the callback function on each day.

#### Params

- **Object** `data`: An object containing the following fields:
- `start` (Moment): A `Moment` date object representing the start date (default: *an year ago*).
- `end` (Moment): A `Moment` date object representing the end date (default: *now*).
Expand All @@ -92,6 +100,7 @@ Iterate through the days, calling the callback function on each day.
Creates an object with the stats on the provided period (default: *last year*).

#### Params

- **Object** `data`: The object passed to the `iterateDays` method.
- **Function** `callback`: The callback function.

Expand All @@ -102,6 +111,7 @@ Creates an object with the stats on the provided period (default: *last year*).
Creates the calendar data for the provided period (default: *last year*).

#### Params

- **Object** `data`: The object passed to the `graph` method.
- **Function** `callback`: The callback function.

Expand All @@ -112,6 +122,7 @@ Creates the calendar data for the provided period (default: *last year*).
Creates the ANSI contributions calendar.

#### Params

- **Object** `options`: The object passed to the `calendar` method.
- **Function** `callback`: The callback function.

Expand All @@ -122,6 +133,7 @@ Creates the ANSI contributions calendar.
Creates an array with the authors of a git repository.

#### Params

- **String|Object** `options`: The repo path or an object containing the following fields:
- `repo` (String): The repository path.
- **Function** `callback`: The callback function.
Expand All @@ -133,6 +145,7 @@ Creates an array with the authors of a git repository.
Creates the authors pie.

#### Params

- **String|Object** `options`: The repo path or an object containing the following fields:
- `repo` (String): The repository path.
- `radius` (Number): The pie radius.
Expand All @@ -147,6 +160,7 @@ Creates the authors pie.
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.
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->


[![git-stats](http://i.imgur.com/Q7TQYHx.png)](#)

# `$ git-stats`

[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][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)
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![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)

> Local git statistics including GitHub-like contributions calendars.
Expand Down Expand Up @@ -230,13 +232,15 @@ g1.ansiCalendar({
});
```



## :question: Get Help

There are few ways to get help:

1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
2. For bug reports and feature requests, open issues. :bug:
3. For direct and quick help from me, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:


## :memo: Documentation
Expand All @@ -260,6 +264,7 @@ this takes time. You can integrate and use these projects in your applications *
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:

- Starring and sharing the projects you like :rocket:
- [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
- [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
- [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
- **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
Expand Down

0 comments on commit 66d63af

Please sign in to comment.