shabegom / buttons

Buttons in Obsidian
The Unlicense
455 stars 47 forks source link

Feature Request - Javascript Button Type #128

Closed Zxilly closed 1 year ago

Zxilly commented 1 year ago

Allow users to eval a piece of Javascript when click the button.

shabegom commented 1 year ago

Not likely to build this directly into buttons.

  1. There are plugins that run js codeblocks such as: obsidian://show-plugin?id=execute-code
  2. You can write JS into a templater file and execute as a template button
mnaoumov commented 11 months ago

@shabegom I think this would be very useful anyway.

Yes, your idea 2 from the previous message would work, but it requires creating a fake template that produces no result which is a dirty hack

For the clearer intent, I think JavaScript button is a must.

Especially useful with the https://github.com/saml-dev/obsidian-custom-js