kevinrenskers/raml2html — pull request #28 by freezy (2014-06-02 14:21:18+00:00)
Title: Make templating engine configurable

I'm integrating RAML compilation into another documentation project where we use [Jade](http://jade-lang.com/) and I'd like to re-use my templates. This adds generic templating by using [consolidate.js](https://github.com/visionmedia/consolidate.js/). Per default handlebars is still used and hence remains the only templating dependency.

An example for usage with Jade would be:

```javascript
raml2html.parseWithConfig('api.raml', {
template: 'template.jade',
templateEngine: 'jade',
templateOptions: { pretty: true },
helpers: {
md: function(markdown) {
return markdown ? marked(markdown) : '';
},
lock: function(securedBy) {
if (securedBy && securedBy.length) {
var index = securedBy.indexOf(null);
if (index !== -1) {
securedBy.splice(index, 1);
}
if (securedBy.length) {
return ' ';
}
}
},
highlight: function(code) {
return code ? highlight.highlightAuto(code).value : '';
}
}
}, function(result) {
console.log(result);
}, function(err) {
console.error('ERROR: %s', err);
});
```

Along with the templates from [this Gist](https://gist.github.com/freezy/a291cec82d3c1aab784c).