mProjectsCode / obsidian-meta-bind-plugin

A plugin for Obsidian to make your notes interactive with inline input fields, metadata displays, and buttons.
https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/
GNU General Public License v3.0
473 stars 38 forks source link

Add option for relative to button line insert into note #347

Closed Tesselay closed 3 months ago

Tesselay commented 3 months ago

Part solution for issue #296.

Enables prepending and appending content in relation to the button. A toggle inside the insertIntoNote action now enables/disables the relative option.

On disable the functionality is all the same.

On enable it allows values below 0; a -1 for example will add the content directly in front of the button. A 1 would add it directly behind it. Employs the position parameter and it's relevant .getPosition() function.

Extended the respective test by adding the new variable. It is only set to false and I haven't (yet) added a new test case that would correctly test the new functionality automatically. I did test it manually though... Running bun run test successfully completed.

bun run check led to an error as it couldn't find the package prettier-plugin-svelte. But this error already occurred before I changed anything so I figured it may not be due to my changes. Possibly it's something on my machine but I'm not sure. The file it tries to import it from .\obsidian-meta-bind-plugin\noop.js doesn't exist either. My apologies if it's an error on my part.

Ramesh-X commented 2 months ago

Why is this closed? Is there an alternative?

Tesselay commented 2 months ago

Not yet. I closed it because I ran into some weird issues when testing it, but it did work generally. I will reimplement this, correctly, and make a pull request when I have a bit more free time.