spumko/hapi — pull request #1113 by Pletcher (2013-10-21 23:46:40+00:00)
Title: updates plugin.views Reference.md entry to a clear and working example

The current example for setting plugin-specific views engines breaks because `require('jade')` returns an object (and so extends and invalidates the options). It also does not clearly show that "jade" refers to the file extension and not the module itself:

```javascript
exports.register = function (plugin, options, next) {

plugin.views({
engines: {
jade: require('jade')
},
path: './templates'
});

next();
};
```

I'm proposing a simple change to the following, which tries to clarify that "html" refers to the file extension of the view template and also shows a working example that follows the guidelines specified in the docs:

```javascript
exports.register = function (plugin, options, next) {

plugin.views({
engines: {
html: {
module: require('handlebars')
}
},
path: './templates'
});

next();
};
```

x