add docs
This commit is contained in:
parent
dc50251538
commit
32d642bb70
43
docs/index.md
Normal file
43
docs/index.md
Normal file
@ -0,0 +1,43 @@
|
||||
# smarthbs
|
||||
handlebars with better fs support
|
||||
|
||||
## Availabililty
|
||||
[](https://www.npmjs.com/package/smarthbs)
|
||||
[](https://GitLab.com/pushrocks/smarthbs)
|
||||
[](https://github.com/pushrocks/smarthbs)
|
||||
[](https://pushrocks.gitlab.io/smarthbs/)
|
||||
|
||||
## Status for master
|
||||
[](https://GitLab.com/pushrocks/smarthbs/commits/master)
|
||||
[](https://GitLab.com/pushrocks/smarthbs/commits/master)
|
||||
[](https://www.npmjs.com/package/smarthbs)
|
||||
[](https://david-dm.org/pushrocks/smarthbs)
|
||||
[](https://www.bithound.io/github/pushrocks/smarthbs/master/dependencies/npm)
|
||||
[](https://www.bithound.io/github/pushrocks/smarthbs)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](http://standardjs.com/)
|
||||
|
||||
## Usage
|
||||
Use TypeScript for best in class instellisense.
|
||||
|
||||
For further information read the linked docs at the top of this README.
|
||||
|
||||
> Note: Why did we decide against a class based architecture?
|
||||
Easy: handlebars.js is already pretty determined how things are handled internally, namely a global partial template registry
|
||||
It doesn't make sense to then introduce a scoped partial template approach.
|
||||
|
||||
```javascript
|
||||
import * as smarthbs from 'smarthbs'
|
||||
|
||||
// read all .hbs files in a directory and any child directories and use relative path as partial string identifier
|
||||
smarthbs.registerPartialDir(testPartialDir)
|
||||
|
||||
// read all .hbs files in a particular directory and level, output them to a destination and specify a .json file to read any referenced data
|
||||
smarthbs.compileDirectory(testHbsDir, testResultDir, 'data.json')
|
||||
```
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||
|
||||
[](https://push.rocks)
|
Loading…
x
Reference in New Issue
Block a user