Skip to content

Commit

Permalink
docs: Improve usage docs, add README
Browse files Browse the repository at this point in the history
  • Loading branch information
keithamus committed Jan 11, 2016
1 parent 0d4c74b commit 0d73aca
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# hbs-cli

This is a tool to render [handlebars](http://handlebarsjs.com) templates, with the ability to require in Partials, Helpers and JSON Data.

```sh
Usage:
hbs --version
hbs --help
hbs [-P <partial>]... [-H <helper>]... [-D <data>]... [-o <directory>] [--] (<template...>)

-h, --help output usage information
-v, --version output the version number
-o, --output <directory> Directory to output rendered templates, defaults to cwd
-P, --partial <glob>... Register a partial (use as many of these as you want)
-H, --helper <glob>... Register a helper (use as many of these as you want)
-D, --data <glob|json>... Parse some data

Examples:

hbs --helper handlebars-layouts --partial ./templates/layout.hbs -- ./index.hbs
hbs --data ./package.json --data ./extra.json ./homepage.hbs --output ./site/
hbs --helpers ./helpers/* --partial ./partials/* ./index.hbs # Supports globs!
```
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,17 @@ if (require.main === module) {
hbs [-P <partial>]... [-H <helper>]... [-D <data>]... [-o <directory>] [--] (<template...>)
-h, --help output usage information
-v, --version output the version number
-o, --output <directory> Directory to output rendered templates, defaults to cwd
-P, --partial <glob>... Register a partial (use as many of these as you want)
-H, --helper <glob>... Register a helper (use as many of these as you want)
-D, --data <glob|json>... Parse some data
-v, --version output the version number
Examples:
hbs --helper handlebars-layouts --partial ./templates/layout.hbs -- ./index.hbs
hbs --obj ./package.json ./homepage.hbs --output ./site/
hbs --data ./package.json --data ./extra.json ./homepage.hbs --output ./site/
hbs --helpers ./helpers/* --partial ./partials/* ./index.hbs # Supports globs!
`);
} else {
const setup = [];
Expand Down

0 comments on commit 0d73aca

Please sign in to comment.