Skip to content

Commit

Permalink
chore(readme): add runtimeOptions to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Jul 6, 2020
1 parent b64284f commit 0ad93e9
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ A [Handlebars][] view engine for [Express][] which doesn't suck.
**This package used to be named `express3-handlebars`. The previous `express-handlebars` package by @jneen can be found [here][jneen-exphbs].**


[Express]: https://github.com/visionmedia/express
[Handlebars]: https://github.com/wycats/handlebars.js
[Express]: https://github.com/expressjs/express
[Handlebars]: https://github.com/handlebars-lang/handlebars.js
[npm]: https://www.npmjs.org/package/express-handlebars
[npm-badge]: https://img.shields.io/npm/v/express-handlebars.svg?style=flat-square
[dep-status]: https://david-dm.org/express-handlebars/express-handlebars
Expand Down Expand Up @@ -155,7 +155,7 @@ var hbs = exphbs.create({ /* config */ });
app.engine('handlebars', hbs.engine);
app.set('view engine', 'handlebars');

// ...still have a reference to `hbs`, on which methods like `loadPartials()`
// ...still have a reference to `hbs`, on which methods like `getPartials()`
// can be called.
```

Expand Down Expand Up @@ -285,16 +285,17 @@ The following is the list of metadata that's accessible on the `{{@exphbs}}` dat
* `data`: Original data object passed when rendering the template.
* `helpers`: Collection of helpers used when rendering the template.
* `partials`: Collection of partials used when rendering the template.
* `runtimeOptions`: Runtime Options used to render the template.


[examples directory]: https://github.com/express-handlebars/express-handlebars/tree/master/examples
[view cache setting]: http://expressjs.com/api.html#app-settings
[Express locals]: http://expressjs.com/api.html#app.locals
[view cache setting]: https://expressjs.com/en/api.html#app.settings.table
[Express locals]: https://expressjs.com/en/api.html#app.locals
[registered with Handlebars]: https://github.com/wycats/handlebars.js/#registering-helpers
[built-in helpers]: http://handlebarsjs.com/#builtins
[Handlebars website]: http://handlebarsjs.com/
[Expression Helpers]: http://handlebarsjs.com/expressions.html#helpers
[Block Helpers]: http://handlebarsjs.com/block_helpers.html
[built-in helpers]: https://handlebarsjs.com/guide/builtin-helpers.html
[Handlebars website]: https://handlebarsjs.com/
[Expression Helpers]: https://handlebarsjs.com/guide/#custom-helpers
[Block Helpers]: https://handlebarsjs.com/guide/#block-helpers


## API
Expand Down Expand Up @@ -362,6 +363,9 @@ An object which holds the helper functions used when rendering templates with th
#### `compilerOptions`
An object which holds options that will be passed along to the Handlebars compiler functions: `Handlebars.compile()` and `Handlebars.precompile()`.

#### `runtimeOptions`
An object which holds options that will be passed along to the template function in addition to the `data`, `helpers`, and `partials` options. See [Runtime Options][] for a list of available options.

### Properties

The public API properties are provided via `ExpressHandlebars` instances. In additional to the properties listed in the **Configuration and Defaults** section, the following are additional public properties:
Expand Down Expand Up @@ -542,6 +546,7 @@ By default this hook simply calls the passed-in `template` with the `context` an


[promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
[Runtime Options]: https://handlebarsjs.com/api-reference/runtime-options.html


## Examples
Expand Down

0 comments on commit 0ad93e9

Please sign in to comment.