Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blah 2.0.0 #19

Merged
merged 16 commits into from
Jun 23, 2015
140 changes: 140 additions & 0 deletions .blah/README.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<!---------------------------------------------------------------------------->
<!-- STOP, LOOK & LISTEN! -->
<!-- ==================== -->
<!-- Do NOT edit this file directly since it's generated from a template -->
<!-- file, using https://github.com/IonicaBizau/node-blah -->
<!-- -->
<!-- If you found a typo in documentation, fix it in the source files -->
<!-- (`lib/*.js`) and make a pull request. -->
<!-- -->
<!-- If you have any other ideas, open an issue. -->
<!-- -->
<!-- Please consider reading the contribution steps (CONTRIBUTING.md). -->
<!-- * * * Thanks! * * * -->
<!---------------------------------------------------------------------------->


<% // Dependencies %>
<% var IsThere = require("is-there"); %>
<% var Fs = require("fs"); %>
<% var Path = require("path"); %>
<% var Ul = require("ul"); %>

<% // Compute the directory paths %>
<% var binPath = Path.join(_.path, "bin"); %>
<% var examplesPath = Path.join(_.path, "examples"); %>
<% var examplePath = Path.join(_.path, "example"); %>
<% var example = IsThere(examplePath) ? examplePath : IsThere(examplesPath) ? examplesPath : null; %>
<% var isCli = IsThere(binPath); %>

<% if (_.pack.blah.h_img) { %>
![<%- _.pack.name %>](<%- _.pack.blah.h_img %>)
<% } %>

<% // Create the name and description %>
<% if (isCli) { %>
# `$ <%- _.pack.name %>` [![Donate now][donate-now]][paypal-donations]
<% } else { %>
# <%- _.pack.name %> [![Donate now][donate-now]][paypal-donations]
<% } %>
<%- _.pack.description %>

<% if (_.pack.blah.ex_img) { %>
![<%- _.pack.name %>](<%-_.pack.blah.ex_img %>)
<% } %>

<% // INSTALLATION %>
## Installation

```sh
$ npm i -g <%- _.pack.name %>
```

<% // Cli usage %>
<% if (isCli) { %>
### CLI Usage
After installing the package globally you can use it as command line tool:

Run `<%- _.pack.name %> --help` and see what `blah` can do.

```sh
$ blah -h
Usage: blah [options]

Options:
-i, --init Inits the .blah directory.
-r, --readme Creates the README.md file.
-g, --gitignore Creates the .gitignore file.
-l, --license <license> Generates a LICENSE file with copyright
information.
-c, --contributing Generates the CONTRIBUTING.md.
-d, --docs <path> Generates the markdown documentation
(DOCUMENTATION.md) for input file.
-b, --bump-version <version> Bumps the package.json version.
-h, --help Displays this help.
-v, --version Displays version information.

Examples:

$ blah --readme # generates the README.md file using package.json
$ blah --gitignore # generates the .gitignore file
$ blah --license mit # generates the LICENSE file taking copyright holder information
# from package.json or GIT variables
$ blah --docs index.js # generates DOCUMENTATION.md from index.js, parsing JSDoc comments
$ blah --bump-version major # bumps the major field of version, in package.json file

Happy Blahing!

Documentation can be found at https://github.com/IonicaBizau/node-blah
```

<% } %>

<% // Show the example if there is one %>
<% if (example) { %>
<% var exStrPath = Path.join(example, "index.js"); %>
<% if (!IsThere(exStrPath)) { %>
<% example = null; %>
<% } %>
<% if (example) { %>
## Example

<% if (isCli) { %>
Here is an example how to use this package as library.
<% } %>

<% var exStr = Fs.readFileSync(exStrPath, "utf-8"); %>
<% exStr = exStr.replace("../lib", _.pack.name) %>

```js
<%- exStr %>
```
<% } %>
<% } %>

<% // Documentation %>
## Documentation

<% if (isCli) { %>
For full API reference, see the [DOCUMENTATION.md][docs] file.
<% } else { %>
<% docs = docs.split("\n").slice(3).join("\n"); %>
<%- docs %>
<% } %>

<% // How to contribute %>
## How to contribute
Have an idea? Found a bug? See [how to contribute][contributing].

<% // License information %>
## License
[KINDLY][license] Β© [IonicΔƒ BizΔƒu][website]–The [LICENSE](/LICENSE) file contains
a copy of the license.

<% // Links %>
[license]: http://ionicabizau.github.io/kindly-license/?author=Ionic%C4%83%20Biz%C4%83u%20%[email protected]%3E&year=2015
[contributing]: /CONTRIBUTING.md
[website]: http://ionicabizau.net
[docs]: /DOCUMENTATION.md
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MG98D7NPFZ3MG
[donate-now]: http://i.imgur.com/jioicaN.png
3 changes: 2 additions & 1 deletion DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ Inits the `.blah` directory in the current project.
#### Params
- **Function** `callback`: The callback function.

### `docs(input, output, callback)`
### `docs(input, output, writeFile, callback)`
Generates the DOCUMENTATION.md file, parsing the input files.

#### Params
- **String** `input`: Input file name (default: main file from package.json)
- **String** `output`: Output file name (default: `DOCUMENTATION.md`)
- **Boolean** `writeFile`: If `false`, the docs will be returned via the callback function, without writing the output file.
- **Function** `callback`: The callback function.

### `readme(callback)`
Expand Down
37 changes: 32 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,45 @@ A command line tool to optimize the repetitive actions.
## Installation

```sh
$ npm i blah
$ npm i -g blah
```

### CLI Usage
You can install the package globally and use it as command line tool:
After installing the package globally you can use it as command line tool:

Run `blah --help` and see what `blah` can do.

```sh
$ npm i -g blah
$ blah -h
Usage: blah [options]

Options:
-i, --init Inits the .blah directory.
-r, --readme Creates the README.md file.
-g, --gitignore Creates the .gitignore file.
-l, --license <license> Generates a LICENSE file with copyright
information.
-c, --contributing Generates the CONTRIBUTING.md.
-d, --docs <path> Generates the markdown documentation
(DOCUMENTATION.md) for input file.
-b, --bump-version <version> Bumps the package.json version.
-h, --help Displays this help.
-v, --version Displays version information.

Examples:

$ blah --readme # generates the README.md file using package.json
$ blah --gitignore # generates the .gitignore file
$ blah --license mit # generates the LICENSE file taking copyright holder information
# from package.json or GIT variables
$ blah --docs index.js # generates DOCUMENTATION.md from index.js, parsing JSDoc comments
$ blah --bump-version major # bumps the major field of version, in package.json file

Happy Blahing!

Documentation can be found at https://github.com/IonicaBizau/node-blah
```

Then, run `blah --help` and see what the cli tool can do.

## Example

Here is an example how to use this package as library.
Expand Down
Loading