patternengine-node-handlebars-extended
v1.0.0
Published
The Extended Handlebars engine for Pattern Lab / Node
Downloads
3
Maintainers
Readme
The Extended Handlebars engine for Pattern Lab 2 / Node
To install the Handlebars engine in your edition, npm install patternengine-node-handlebars-extended
should do the trick.
By adding patternlab-handlebars-config.js
to your project root you may extend the Handlebars instance:
module.exports = function (Handlebars) {
/*
Register a Helper called `list` which lets you pass values between patterns:
Examples:
{{>partialName class=(list classNames)}}
{{>partialName class=(list 'closs-one class-two')}}
{{>partialName class=(list 'closs-one' 'class-two')}}
*/
Handlebars.registerHelper('list', (...args) => {
args.pop(); // pop options
const a = [];
return a.concat.apply(a, args);
});
};
Supported features
- [x] Includes
- [x] Lineage
- [x] Hidden Patterns
- [x] Pseudo-Patterns
- [x] Pattern States
- [ ] Pattern Parameters (Accomplished instead using native Handlebars partial arguments)
- [ ] Style Modifiers (Accomplished instead using native Handlebars partial arguments)