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

I need some example for customJSForHandlebars #25

Open
x1brn opened this issue Sep 22, 2024 · 6 comments
Open

I need some example for customJSForHandlebars #25

x1brn opened this issue Sep 22, 2024 · 6 comments

Comments

@x1brn
Copy link

x1brn commented Sep 22, 2024

Example for customJSForSql works fine. but I cannot write code for customJSForHandlebars. could you give me some examples?

@sytone
Copy link
Owner

sytone commented Sep 25, 2024

Let me look for a example I had, I do not use this often at the moment so need to check as I moved all the handlebars I needed to the code :)

Also apologies for delay the notifications were not getting sent to my email and were being blocked.

@sytone
Copy link
Owner

sytone commented Oct 2, 2024

I have done a hunt and I have not got a reference for this, I also have not rewired the calls since the last code rewrite so it would not work anyway. I will need to create a dummy one and get it flowing through.

What are y ou wanting in a handlebars helper?

@x1brn
Copy link
Author

x1brn commented Oct 2, 2024

for example, simple "eq" helper.

{{#eq value1 value2}}
  <!-- When the two values are equal -->
  <p>The values are equal.</p>
{{else}}
  <!-- When the two values are not equal -->
  <p>The values are not equal.</p>
{{/eq}}

ref. https://gist.github.com/tracend/7522125

sytone added a commit that referenced this issue Oct 2, 2024
Added relation operators based on example from Makis Tracend, this includes example documents as well as tests.
@sytone
Copy link
Owner

sytone commented Oct 2, 2024

These looked handy, I just committed a change adding them with examples and tests. Thanks for the reference. The wire up of the custom items will take a while so hope this helps in the interim. Ill release a new version later today with this feature.

@RitchieMatt
Copy link

I find handlebars indispensable for note creation automation, therefore the use of Handlebars Helpers.
I've found the JSON importer plugin does this very well. Obsidian JSON Importer

It implements the entire Handlebars Helpers CI library Handlebars Helpers CI Git. It has pretty much everything I need already made with documentation.

Perhaps you could checkout the code for both of these and see if you can implement it in your plugin somehow?

@sytone
Copy link
Owner

sytone commented Oct 3, 2024

If I remember correctly I tried to add the library but it ended up exploding into little pieces at the time. Ill have a look again to see if I can get it integrated.

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

No branches or pull requests

3 participants