New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to write my own handlebars helper and use it in patternlab-node? #958
Comments
So I tried writing my own plugin and use it via Edit I had a hard time finding this one, this should definitely be pointed out in the documentation! |
I have not tried writing a plugin recently, but I'm thinking that this functionality might be interesting inside the handlebars engine. Something like this:
The React engine seems to do something similar:
|
Got something working, submitting PR soon |
@engelfrost really nice! Thank you! In the meanwhile I published a Pattern Lab plugin to resolve my usecase. If anyone is interested, feel free to use https://www.npmjs.com/package/plugin-node-patternlab-inline-assets |
@Miw0 Cool, you figured the plugin thing out! I might combine our two solutions to make a helper-loading plugin. |
@Miw0 @engelfrost |
Thanks @david-moldenhauer. A common way to add helpers/extensions to both Handlebars and Nunjucks is making it's way into the engines themselves now. If you have knowledge to add to the PR linked above based on your plugin that would be great! |
I first thought you build a plugin which would allow me to add any handlebars helper I need but I see that your plugin ist just a collection of useful util helpers. Anyway thanks for posting, this would have helped me alot 2 weeks ago! |
It's hard to keep track of everything. This issue has been automatically marked as stale because it has not had recent activity, neither from the team nor the community. It will be closed if no further activity occurs. Please consider adding additional info, volunteering to contribute a fix for this issue, or making a further case that this is important to you, the team, and the project as a whole. Thanks! |
Issue closed after going stale. It can be re-opened if still relevant. |
Still relevant, waiting for PR to be processed |
It's hard to keep track of everything. This issue has been automatically marked as stale because it has not had recent activity, neither from the team nor the community. It will be closed if no further activity occurs. Please consider adding additional info, volunteering to contribute a fix for this issue, or making a further case that this is important to you, the team, and the project as a whole. Thanks! |
Still relevant |
For anyone else who is impatient and needs this in PL v2 I've created this Handlebars Engine for myself. The project will not be maintained in the long run: https://github.com/engelfrost/patternengine-node-handlebars-extended |
It's hard to keep track of everything. This issue has been automatically marked as stale because it has not had recent activity, neither from the team nor the community. It will be closed if no further activity occurs. Please consider adding additional info, volunteering to contribute a fix for this issue, or making a further case that this is important to you, the team, and the project as a whole. Thanks! |
Issue closed after going stale. It can be re-opened if still relevant. |
PR still waiting to be processed |
It's hard to keep track of everything. This issue has been automatically marked as stale because it has not had recent activity, neither from the team nor the community. It will be closed if no further activity occurs. Please consider adding additional info, volunteering to contribute a fix for this issue, or making a further case that this is important to you, the team, and the project as a whole. Thanks! |
I am using Pattern Lab Node
v2.12.0
onWindows
, with Nodev8.11.1
, using aGulp
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.
The text was updated successfully, but these errors were encountered: