LiamRiddell / obsidian-solve

An unobtrusive Obsidian plugin that quietly processes equations and patterns in real time
MIT License
72 stars 0 forks source link

[Feature Request] Add toggle option for triggering calculations #11

Closed otherfutures closed 10 months ago

otherfutures commented 1 year ago

Is your feature request related to a problem? Please describe. I think this add on is very impressive! I just wanted to make a suggestion that the user should be able to decide when a string is calculated rather than it automatically being calculated every time (for example, what if you just want to type 'now' in your notes without it displaying the current datetime? You'd have to go into settings & disable the add on & then reenable it after typing the word--not a big deal, but more hassle than, say, a hotkey command).

Describe the solution you'd like I think a hotkey command to trigger the add on's calculation would make a lot of sense. There could also be a settings/config option to always calculate for people who don't want to keep hitting the hotkey (for notes very heavy in maths, perhaps).

Describe alternatives you've considered Just leave it as is if this feels like too much of an edge case.

Additional context Add any other context or screenshots about the feature request here.

LiamRiddell commented 1 year ago

Thank you for the feature request @otherfutures.

I agree, I was thinking the ability to switch the trigger mode between Automatic and Manual.

This would tick off the above use case. I feel this is a completely reasonable feature request and should be done. However, technically speaking, at the moment I don't believe it's possible to trigger a CodeMirror 6 plugin manually from code. This would be the main hurdle for above functionality.

I'll keep this open and plan it in to a future release. Thank you for using Solve :)

corbing commented 10 months ago

Along these same lines, it would be nice to have an option to only calculate a line if the user enters the equal symbol.

After installing Solve, I now have all kinds of weird calculations in my notes. For example, I often use dates as breaks in the format:

2023-01-24 which now has " = 1998" after the date Or, I have a line that simply said "14595". That line is now 14595 = 14595

LiamRiddell commented 10 months ago

Hi @corbing, thank you for providing more information. I've added a new mode called explicit. This tells the Solve engine to only process sentences that end with = sign. This will also help with the original ticket. Additionally, I've added in a fix to prevent pointless solves as you mentioned 14595 = 14595. Lastly, I've added provider management to Solve which allows you to enable/disable any provider. This should help clean up unwanted Solves in documents. This should be out today in 0.6.0 :)

corbing commented 10 months ago

Amazing! That works perfectly! Similar functionality was built into OneNote, which I used for a decade before Obsidian. I've missed having a quick and easy way to Solve in notes but your plugin fills that void wonderfully.

LiamRiddell commented 10 months ago

Amazing! That works perfectly! Similar functionality was built into OneNote, which I used for a decade before Obsidian. I've missed having a quick and easy way to Solve in notes but your plugin fills that void wonderfully.

That's great news, I'd love to hear if there are other features that are within scope of Solve from your time with OneNote or other services. Thank you so much for contributing to the project. ❤️