mProjectsCode / mProjectsCode/obsidian-meta-bind-plugin

Ability to provide a callback function to metabind button

Open
#580 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request todo
Dominant language
TypeScript
Stars
1k
Forks
86
PR merge metrics
No merged PRs in 30d

Description

Please fill out these Check-boxes
  • I checked for existing similar feature requests
  • I have read the docs and checked that the feature I am requesting is not already implemented
  • My feature request consists of only one feature
Is your Feature Request related to a Problem or Annoyance?

Metabind buttons are great when you use them from markdown but if I want to use them from API then the fact that I can't connect them to a simple javascript callback is very annoying. Sure I can use evaluate or give them source file path, but I am already in code, it'd be much simpler to just give it a callback.

Describe the Feature you'd like

Give me a simple way to invoke callback, e.g.:

{
          type: ButtonActionType.JS_CALLBACK,
          value: () => { console.log("Hello world!")
}
Alternatives

The following types are as close as we can get:

  • inlineJS
  • js

Which is not ideal, especially if you want to share some context between your code and the button callback

Additional Context

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by reading the metabind button API and the existing inlineJS and js action types; confirm how API-created buttons are dispatched. Done means an API caller can provide a JavaScript callback that runs when the button is activated while preserving access to the caller's context.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.