I am using Pattern Lab Node v2.12.0 on Windows, with Node v8.11.1, using a Gulp Edition.
I am very confused how to actually write my own handlebars helper and use it in patternlab-node. I read there are patternlab plugins but is this the correct way to load a handlebars helper?
I hope someone can point me in the right direction. I also didn't find any information about plugins or whatsoever on the official documentation page.
Thanks in advance.
For anyone also interested in this, I can recommend reading the issue I opened here https://github.com/pattern-lab/patternlab-node/issues/958 or read the source code of a working plugin I finally managed to create and publish here https://www.npmjs.com/package/plugin-node-patternlab-inline-assets .
Some clues I found out while reading Pattern Lab Node's source code
module.exports = (patternlab) => { if (!patternlab) { process.exit(1); } patternlab.engines.handlebars.engine.registerHelper('your-helper', (parameter) => { return 'your result of the helper'; }); };
For further reading, see the poor documentation: https://github.com/pattern-lab/patternlab-node/wiki/Creating-Plugins
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.