Open x1brn opened 1 month ago
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.
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?
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}}
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.
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?
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.
Example for customJSForSql works fine. but I cannot write code for customJSForHandlebars. could you give me some examples?