Skip to content
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

Feature Request: Add Logic to Handlebars #64

Open
ImperialSquid opened this issue May 7, 2022 · 6 comments
Open

Feature Request: Add Logic to Handlebars #64

ImperialSquid opened this issue May 7, 2022 · 6 comments
Assignees
Labels
next-release Features that are implemented and are waiting for new plugin release.

Comments

@ImperialSquid
Copy link
Contributor

Would it be possible to add comparisons for note variables? It would be really useful, for example, to be able to choose the number of topics to generate, like so:

---
topic_count:
  label: Number of topics (up to 5)
  type: number

---
{{#if topic_count>=1}}
# Topic 1

{{/if}}
{{#if topic_count>=2}}
# Topic 2

{{/if}}
{{#if topic_count>=3}}
# Topic 3

{{/if}}
@ImperialSquid
Copy link
Contributor Author

Revisiting this much later, this post on SO seems to have a good way to add logical operators into the template

@ImperialSquid ImperialSquid changed the title Feature Request: Integer Comparison Feature Request: Add Logic to Handlebars Aug 30, 2022
@nishantwrp
Copy link
Collaborator

Thanks @ImperialSquid, I'm a little occupied these days. I'd encourage you to raise a pull request since you've figured out how to implement this to some extent.

@ImperialSquid
Copy link
Contributor Author

I have like none of the dev environment set up for this kinda work since I do python and R most days but I'll see what I can do if I get a chunk of time 😅👌

@ImperialSquid
Copy link
Contributor Author

Hey @nishantwrp, I've got a bit more experience in js since posting this and remembered I posted the issue a while back, was just wondering if you'd still accept a pr to add this feature?

Also do you have any ideas about a name for the handler? I was thinking {{#compare X > Y}} but it's your plugin so up to you!

@nishantwrp
Copy link
Collaborator

Hey @ImperialSquid, yes sure please raise a pull request. compare looks good.

@nishantwrp
Copy link
Collaborator

Implemented in #79. This feature will go out in the next release.

@nishantwrp nishantwrp added the next-release Features that are implemented and are waiting for new plugin release. label Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next-release Features that are implemented and are waiting for new plugin release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants