Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature request: Support for importing built-in helpers from handlerbars.java #148

Closed
vjda opened this issue Apr 20, 2023 · 2 comments
Closed

Comments

@vjda
Copy link

vjda commented Apr 20, 2023

It would be great to have a way to import automatically the built-in helpers from the dependency handlebars.java in order to reuse them in the templates to render the changelog text.

Currently, if we try to use one of the helpers available in handlebars.java we get an exception. For instance, for a template similar to this:

{{#commits}}
    {{#ifCommitBreaking .}}
- **{{capitalizeFirst messageTitle}}** ([{{hash}}]({{gitLabProjectUrl}}/commit/{{hashFull}}))
    {{/ifCommitBreaking}}
{{/commits}}

git-changelog-command-line throws the following error:

Exception in thread "main" com.github.jknack.handlebars.HandlebarsException: inline@64a82ec9:16:6: could not find helper: 'capitalizeFirst'
- **{{capitalizeFirst messageTitle}}** ([{{hash}}]({{gitLabProjectUrl}}/commit/{{hashFull}}))
      ^

Notice that capitalizeFirst comes from StringHelpers.java.

I've been diving into the git-changelog-lib code for some time but I'm not very familiar with it, so I can't really estimate how much effort it would take to do the functionality. But let me know if I can help at all.

Thanks in advance.

tomasbjerre added a commit that referenced this issue Apr 22, 2023
@tomasbjerre
Copy link
Owner

StringHelpers is now included.

@vjda
Copy link
Author

vjda commented Apr 24, 2023

awesome! thanks @tomasbjerre !

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants