-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: 📝 add docs around adding helpers.
- Loading branch information
Adam Simpson
committed
Nov 3, 2017
1 parent
80d8c99
commit 9d362cb
Showing
2 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,38 @@ | ||
# Downpour | ||
|
||
Sparkbox implementation of [drizzle-builder](https://www.npmjs.com/package/drizzle-builder) | ||
Sparkbox implementation of [drizzle-builder][db] | ||
|
||
|
||
## Usage | ||
|
||
Downpour exposes the [drizzle-builder][db] as a function to compile handlebars templates into HTML. | ||
|
||
All [drizzle-builder options](https://github.com/cloudfour/drizzle-builder#options) are valid. | ||
|
||
Downpour includes a few handlebars helpers by default: | ||
|
||
- all [@cloudfour/hbs-helpers](https://github.com/cloudfour/core-hbs-helpers/tree/master/lib) | ||
- [ifProd](https://github.com/sparkbox/ifProd-helper) | ||
- [is][assemble] | ||
- [isn't][assemble] | ||
- [split][assemble] | ||
|
||
To add additional helpers create a `helpers` key in the options object like so: | ||
|
||
``` javascript | ||
const downpour = require('downpour'); | ||
const { myHelperFunc } = require('my-helper-package'); | ||
|
||
const opts = { | ||
helpers: { | ||
myHelper: myHelperFunc, | ||
}, | ||
}; | ||
|
||
downpour(opts, cb); | ||
|
||
``` | ||
|
||
|
||
[db]: https://www.npmjs.com/package/drizzle-builder | ||
[assemble]: https://github.com/helpers/handlebars-helpers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters