From 66d63af1ad822812f01ca12daa20b2b7cf0c57c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionic=C4=83=20Biz=C4=83u?= Date: Fri, 8 Sep 2017 13:56:03 +0300 Subject: [PATCH] Updated docs --- .gitignore | 3 +++ DOCUMENTATION.md | 14 ++++++++++++++ README.md | 9 +++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 61f2900..af96bda 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ *~ *.log node_modules +*.env +.DS_Store +package-lock.json diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 9e0a12b..28c5ef1 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -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 @@ -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 @@ -23,6 +25,7 @@ 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. @@ -30,6 +33,7 @@ Inits the configuration field (`this.config`). 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. @@ -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. @@ -60,6 +65,7 @@ Deletes a specifc commit from the history. Gets the git stats. #### Params + - **Function** `callback`: The callback function. #### Return @@ -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. @@ -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*). @@ -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. @@ -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. @@ -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. @@ -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. @@ -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. @@ -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. diff --git a/README.md b/README.md index 074b1cf..3eee4b4 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ + + [![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. @@ -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 @@ -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`